blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f5d4a1ae55d560b9baf713c69e67ca9326ef473b | 18cded95652684e2d184e599b808beccd0072a69 | /src/exceptions.h | 4da2236c0117da2eb40eb5cdb55337681edfb82e | [
"MIT"
] | permissive | mir-group/phoebe | 226db27b50d1c6e5918ce7d3b7946c3a615203cd | 4850de7b19ad16022b570be99c8cc4d8cf435cae | refs/heads/develop | 2023-09-02T07:35:16.722468 | 2023-08-24T18:41:57 | 2023-08-24T18:41:57 | 243,034,518 | 77 | 19 | MIT | 2023-08-24T18:41:58 | 2020-02-25T15:30:45 | C++ | UTF-8 | C++ | false | false | 592 | h | #ifndef EXCEPTIONS_H
#define EXCEPTIONS_H
#include <cassert>
#include <iostream>
#include <string>
/** Object used to print an error message, and stop the code.
*/
class Error {
public:
/** object constructor.
* @param errorMessage: message to be print to the user.
* @param errCode: return integer error code, should be different from 0!
*/
explicit Error(const std::string &errMessage, const int &errCode = 1);
};
/** Object to print a warning to the user, without stopping the code
*/
class Warning {
public:
explicit Warning(const std::string &errMessage);
};
#endif
| [
"andrea.cepellotti@gmail.com"
] | andrea.cepellotti@gmail.com |
83579454603e8295aa11610caf24186b4bd37b92 | e0d50712461f60626ab6600a230e5b5f475c636c | /ui/inventory_event_common.h | 4b638baf247bb1725d5a87b51f2af07e9b1b1708 | [
"MIT"
] | permissive | astrellon/Rouge | a4939c519da900d0a42d10ae0bff427ac4c2aa56 | 088f55b331284238e807e0562b9cbbed6428c20f | refs/heads/master | 2021-01-23T08:39:52.749013 | 2018-08-31T07:33:38 | 2018-08-31T07:33:38 | 11,255,211 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 272 | h | #pragma once
namespace am {
namespace ui {
class Inventory
{
public:
enum EventType
{
INVENTORY_ADD, INVENTORY_REMOVE, INVENTORY_BEFORE_ADD,
INVENTORY_BEFORE_REMOVE
};
static const char *EventTypeName[];
};
}
}
| [
"sovereign250@gmail.com"
] | sovereign250@gmail.com |
4b93e1d488517da06e416221b0ef79ab573e2e4a | 190219e4aca487f7c65de81484b993b362825131 | /v2/external/llvm-2.8/lib/Target/MBlaze/MBlazeRegisterInfo.cpp | 22b6a30470d170eb4287ee06362bb7be9f0e08ac | [
"NCSA",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | dilawar/ahir | b6a56ed5c61f121c09ef6636d7dd2752d97529b5 | 9c5592a4df7a47b9c1e406778cc7c17316bcfb4e | refs/heads/master | 2021-07-14T18:04:20.484255 | 2020-07-26T20:18:34 | 2020-07-26T20:18:34 | 184,123,680 | 1 | 0 | NOASSERTION | 2019-04-29T18:34:26 | 2019-04-29T18:34:26 | null | UTF-8 | C++ | false | false | 14,426 | cpp | //===- MBlazeRegisterInfo.cpp - MBlaze Register Information -== -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the MBlaze implementation of the TargetRegisterInfo
// class.
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "mblaze-reg-info"
#include "MBlaze.h"
#include "MBlazeSubtarget.h"
#include "MBlazeRegisterInfo.h"
#include "MBlazeMachineFunction.h"
#include "llvm/Constants.h"
#include "llvm/Type.h"
#include "llvm/Function.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
using namespace llvm;
MBlazeRegisterInfo::
MBlazeRegisterInfo(const MBlazeSubtarget &ST, const TargetInstrInfo &tii)
: MBlazeGenRegisterInfo(MBlaze::ADJCALLSTACKDOWN, MBlaze::ADJCALLSTACKUP),
Subtarget(ST), TII(tii) {}
/// getRegisterNumbering - Given the enum value for some register, e.g.
/// MBlaze::R0, return the number that it corresponds to (e.g. 0).
unsigned MBlazeRegisterInfo::getRegisterNumbering(unsigned RegEnum) {
switch (RegEnum) {
case MBlaze::R0 : case MBlaze::F0 : return 0;
case MBlaze::R1 : case MBlaze::F1 : return 1;
case MBlaze::R2 : case MBlaze::F2 : return 2;
case MBlaze::R3 : case MBlaze::F3 : return 3;
case MBlaze::R4 : case MBlaze::F4 : return 4;
case MBlaze::R5 : case MBlaze::F5 : return 5;
case MBlaze::R6 : case MBlaze::F6 : return 6;
case MBlaze::R7 : case MBlaze::F7 : return 7;
case MBlaze::R8 : case MBlaze::F8 : return 8;
case MBlaze::R9 : case MBlaze::F9 : return 9;
case MBlaze::R10 : case MBlaze::F10 : return 10;
case MBlaze::R11 : case MBlaze::F11 : return 11;
case MBlaze::R12 : case MBlaze::F12 : return 12;
case MBlaze::R13 : case MBlaze::F13 : return 13;
case MBlaze::R14 : case MBlaze::F14 : return 14;
case MBlaze::R15 : case MBlaze::F15 : return 15;
case MBlaze::R16 : case MBlaze::F16 : return 16;
case MBlaze::R17 : case MBlaze::F17 : return 17;
case MBlaze::R18 : case MBlaze::F18 : return 18;
case MBlaze::R19 : case MBlaze::F19 : return 19;
case MBlaze::R20 : case MBlaze::F20 : return 20;
case MBlaze::R21 : case MBlaze::F21 : return 21;
case MBlaze::R22 : case MBlaze::F22 : return 22;
case MBlaze::R23 : case MBlaze::F23 : return 23;
case MBlaze::R24 : case MBlaze::F24 : return 24;
case MBlaze::R25 : case MBlaze::F25 : return 25;
case MBlaze::R26 : case MBlaze::F26 : return 26;
case MBlaze::R27 : case MBlaze::F27 : return 27;
case MBlaze::R28 : case MBlaze::F28 : return 28;
case MBlaze::R29 : case MBlaze::F29 : return 29;
case MBlaze::R30 : case MBlaze::F30 : return 30;
case MBlaze::R31 : case MBlaze::F31 : return 31;
default: llvm_unreachable("Unknown register number!");
}
return 0; // Not reached
}
/// getRegisterFromNumbering - Given the enum value for some register, e.g.
/// MBlaze::R0, return the number that it corresponds to (e.g. 0).
unsigned MBlazeRegisterInfo::getRegisterFromNumbering(unsigned Reg) {
switch (Reg) {
case 0 : return MBlaze::R0;
case 1 : return MBlaze::R1;
case 2 : return MBlaze::R2;
case 3 : return MBlaze::R3;
case 4 : return MBlaze::R4;
case 5 : return MBlaze::R5;
case 6 : return MBlaze::R6;
case 7 : return MBlaze::R7;
case 8 : return MBlaze::R8;
case 9 : return MBlaze::R9;
case 10 : return MBlaze::R10;
case 11 : return MBlaze::R11;
case 12 : return MBlaze::R12;
case 13 : return MBlaze::R13;
case 14 : return MBlaze::R14;
case 15 : return MBlaze::R15;
case 16 : return MBlaze::R16;
case 17 : return MBlaze::R17;
case 18 : return MBlaze::R18;
case 19 : return MBlaze::R19;
case 20 : return MBlaze::R20;
case 21 : return MBlaze::R21;
case 22 : return MBlaze::R22;
case 23 : return MBlaze::R23;
case 24 : return MBlaze::R24;
case 25 : return MBlaze::R25;
case 26 : return MBlaze::R26;
case 27 : return MBlaze::R27;
case 28 : return MBlaze::R28;
case 29 : return MBlaze::R29;
case 30 : return MBlaze::R30;
case 31 : return MBlaze::R31;
default: llvm_unreachable("Unknown register number!");
}
return 0; // Not reached
}
unsigned MBlazeRegisterInfo::getPICCallReg() {
return MBlaze::R20;
}
//===----------------------------------------------------------------------===//
// Callee Saved Registers methods
//===----------------------------------------------------------------------===//
/// MBlaze Callee Saved Registers
const unsigned* MBlazeRegisterInfo::
getCalleeSavedRegs(const MachineFunction *MF) const {
// MBlaze callee-save register range is R20 - R31
static const unsigned CalleeSavedRegs[] = {
MBlaze::R20, MBlaze::R21, MBlaze::R22, MBlaze::R23,
MBlaze::R24, MBlaze::R25, MBlaze::R26, MBlaze::R27,
MBlaze::R28, MBlaze::R29, MBlaze::R30, MBlaze::R31,
0
};
return CalleeSavedRegs;
}
BitVector MBlazeRegisterInfo::
getReservedRegs(const MachineFunction &MF) const {
BitVector Reserved(getNumRegs());
Reserved.set(MBlaze::R0);
Reserved.set(MBlaze::R1);
Reserved.set(MBlaze::R2);
Reserved.set(MBlaze::R13);
Reserved.set(MBlaze::R14);
Reserved.set(MBlaze::R15);
Reserved.set(MBlaze::R16);
Reserved.set(MBlaze::R17);
Reserved.set(MBlaze::R18);
Reserved.set(MBlaze::R19);
return Reserved;
}
//===----------------------------------------------------------------------===//
//
// Stack Frame Processing methods
// +----------------------------+
//
// The stack is allocated decrementing the stack pointer on
// the first instruction of a function prologue. Once decremented,
// all stack references are are done through a positive offset
// from the stack/frame pointer, so the stack is considered
// to grow up.
//
//===----------------------------------------------------------------------===//
void MBlazeRegisterInfo::adjustMBlazeStackFrame(MachineFunction &MF) const {
MachineFrameInfo *MFI = MF.getFrameInfo();
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
// See the description at MicroBlazeMachineFunction.h
int TopCPUSavedRegOff = -1;
// Adjust CPU Callee Saved Registers Area. Registers RA and FP must
// be saved in this CPU Area there is the need. This whole Area must
// be aligned to the default Stack Alignment requirements.
unsigned StackOffset = MFI->getStackSize();
unsigned RegSize = 4;
// Replace the dummy '0' SPOffset by the negative offsets, as explained on
// LowerFORMAL_ARGUMENTS. Leaving '0' for while is necessary to avoid
// the approach done by calculateFrameObjectOffsets to the stack frame.
MBlazeFI->adjustLoadArgsFI(MFI);
MBlazeFI->adjustStoreVarArgsFI(MFI);
if (hasFP(MF)) {
MFI->setObjectOffset(MFI->CreateStackObject(RegSize, RegSize, true),
StackOffset);
MBlazeFI->setFPStackOffset(StackOffset);
TopCPUSavedRegOff = StackOffset;
StackOffset += RegSize;
}
if (MFI->adjustsStack()) {
MBlazeFI->setRAStackOffset(0);
MFI->setObjectOffset(MFI->CreateStackObject(RegSize, RegSize, true),
StackOffset);
TopCPUSavedRegOff = StackOffset;
StackOffset += RegSize;
}
// Update frame info
MFI->setStackSize(StackOffset);
// Recalculate the final tops offset. The final values must be '0'
// if there isn't a callee saved register for CPU or FPU, otherwise
// a negative offset is needed.
if (TopCPUSavedRegOff >= 0)
MBlazeFI->setCPUTopSavedRegOff(TopCPUSavedRegOff-StackOffset);
}
// hasFP - Return true if the specified function should have a dedicated frame
// pointer register. This is true if the function has variable sized allocas or
// if frame pointer elimination is disabled.
bool MBlazeRegisterInfo::hasFP(const MachineFunction &MF) const {
const MachineFrameInfo *MFI = MF.getFrameInfo();
return DisableFramePointerElim(MF) || MFI->hasVarSizedObjects();
}
// This function eliminate ADJCALLSTACKDOWN,
// ADJCALLSTACKUP pseudo instructions
void MBlazeRegisterInfo::
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const {
// Simply discard ADJCALLSTACKDOWN, ADJCALLSTACKUP instructions.
MBB.erase(I);
}
// FrameIndex represent objects inside a abstract stack.
// We must replace FrameIndex with an stack/frame pointer
// direct reference.
void MBlazeRegisterInfo::
eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
RegScavenger *RS) const {
MachineInstr &MI = *II;
MachineFunction &MF = *MI.getParent()->getParent();
unsigned i = 0;
while (!MI.getOperand(i).isFI()) {
++i;
assert(i < MI.getNumOperands() &&
"Instr doesn't have FrameIndex operand!");
}
unsigned oi = i == 2 ? 1 : 2;
DEBUG(errs() << "\nFunction : " << MF.getFunction()->getName() << "\n";
errs() << "<--------->\n" << MI);
int FrameIndex = MI.getOperand(i).getIndex();
int stackSize = MF.getFrameInfo()->getStackSize();
int spOffset = MF.getFrameInfo()->getObjectOffset(FrameIndex);
DEBUG(errs() << "FrameIndex : " << FrameIndex << "\n"
<< "spOffset : " << spOffset << "\n"
<< "stackSize : " << stackSize << "\n");
// as explained on LowerFormalArguments, detect negative offsets
// and adjust SPOffsets considering the final stack size.
int Offset = (spOffset < 0) ? (stackSize - spOffset) : (spOffset + 4);
Offset += MI.getOperand(oi).getImm();
DEBUG(errs() << "Offset : " << Offset << "\n" << "<--------->\n");
MI.getOperand(oi).ChangeToImmediate(Offset);
MI.getOperand(i).ChangeToRegister(getFrameRegister(MF), false);
}
void MBlazeRegisterInfo::
emitPrologue(MachineFunction &MF) const {
MachineBasicBlock &MBB = MF.front();
MachineFrameInfo *MFI = MF.getFrameInfo();
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
MachineBasicBlock::iterator MBBI = MBB.begin();
DebugLoc DL = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
// Get the right frame order for MBlaze.
adjustMBlazeStackFrame(MF);
// Get the number of bytes to allocate from the FrameInfo.
unsigned StackSize = MFI->getStackSize();
// No need to allocate space on the stack.
if (StackSize == 0 && !MFI->adjustsStack()) return;
if (StackSize < 28 && MFI->adjustsStack()) StackSize = 28;
int FPOffset = MBlazeFI->getFPStackOffset();
int RAOffset = MBlazeFI->getRAStackOffset();
// Adjust stack : addi R1, R1, -imm
BuildMI(MBB, MBBI, DL, TII.get(MBlaze::ADDI), MBlaze::R1)
.addReg(MBlaze::R1).addImm(-StackSize);
// Save the return address only if the function isnt a leaf one.
// swi R15, R1, stack_loc
if (MFI->adjustsStack()) {
BuildMI(MBB, MBBI, DL, TII.get(MBlaze::SWI))
.addReg(MBlaze::R15).addImm(RAOffset).addReg(MBlaze::R1);
}
// if framepointer enabled, save it and set it
// to point to the stack pointer
if (hasFP(MF)) {
// swi R19, R1, stack_loc
BuildMI(MBB, MBBI, DL, TII.get(MBlaze::SWI))
.addReg(MBlaze::R19).addImm(FPOffset).addReg(MBlaze::R1);
// add R19, R1, R0
BuildMI(MBB, MBBI, DL, TII.get(MBlaze::ADD), MBlaze::R19)
.addReg(MBlaze::R1).addReg(MBlaze::R0);
}
}
void MBlazeRegisterInfo::
emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const {
MachineBasicBlock::iterator MBBI = prior(MBB.end());
MachineFrameInfo *MFI = MF.getFrameInfo();
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
DebugLoc dl = MBBI->getDebugLoc();
// Get the FI's where RA and FP are saved.
int FPOffset = MBlazeFI->getFPStackOffset();
int RAOffset = MBlazeFI->getRAStackOffset();
// if framepointer enabled, restore it and restore the
// stack pointer
if (hasFP(MF)) {
// add R1, R19, R0
BuildMI(MBB, MBBI, dl, TII.get(MBlaze::ADD), MBlaze::R1)
.addReg(MBlaze::R19).addReg(MBlaze::R0);
// lwi R19, R1, stack_loc
BuildMI(MBB, MBBI, dl, TII.get(MBlaze::LWI), MBlaze::R19)
.addImm(FPOffset).addReg(MBlaze::R1);
}
// Restore the return address only if the function isnt a leaf one.
// lwi R15, R1, stack_loc
if (MFI->adjustsStack()) {
BuildMI(MBB, MBBI, dl, TII.get(MBlaze::LWI), MBlaze::R15)
.addImm(RAOffset).addReg(MBlaze::R1);
}
// Get the number of bytes from FrameInfo
int StackSize = (int) MFI->getStackSize();
if (StackSize < 28 && MFI->adjustsStack()) StackSize = 28;
// adjust stack.
// addi R1, R1, imm
if (StackSize) {
BuildMI(MBB, MBBI, dl, TII.get(MBlaze::ADDI), MBlaze::R1)
.addReg(MBlaze::R1).addImm(StackSize);
}
}
void MBlazeRegisterInfo::
processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
// Set the stack offset where GP must be saved/loaded from.
MachineFrameInfo *MFI = MF.getFrameInfo();
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
if (MBlazeFI->needGPSaveRestore())
MFI->setObjectOffset(MBlazeFI->getGPFI(), MBlazeFI->getGPStackOffset());
}
unsigned MBlazeRegisterInfo::getRARegister() const {
return MBlaze::R15;
}
unsigned MBlazeRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
return hasFP(MF) ? MBlaze::R19 : MBlaze::R1;
}
unsigned MBlazeRegisterInfo::getEHExceptionRegister() const {
llvm_unreachable("What is the exception register");
return 0;
}
unsigned MBlazeRegisterInfo::getEHHandlerRegister() const {
llvm_unreachable("What is the exception handler register");
return 0;
}
int MBlazeRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
llvm_unreachable("What is the dwarf register number");
return -1;
}
#include "MBlazeGenRegisterInfo.inc"
| [
"dilawars@ncbs.res.in"
] | dilawars@ncbs.res.in |
f4b691fe70e0a0bcd2eb4df7196d11280321c4e8 | df950fa055a061956e95af1ddf6797b111f2a147 | /libs/core---linux/platform.h | 9b52d3e1e6f0df81d07f3d2bd2dfc8ea539f9298 | [
"MIT"
] | permissive | DalavanCloud/pxt-common-packages | 020ec0832ea4f4228d8f0dec9e3f045ed8ba36b8 | c16ac9a3129d2b665d995223fc24f7be89a029e5 | refs/heads/master | 2020-03-30T07:18:51.264936 | 2018-09-26T01:27:05 | 2018-09-26T01:27:05 | 150,931,323 | 1 | 0 | MIT | 2018-09-30T04:45:54 | 2018-09-30T04:45:54 | null | UTF-8 | C++ | false | false | 540 | h | #ifndef __PXT_PLATFORM_H
#define __PXT_PLATFORM_H
#define PAGE_SIZE 1024 // not really
#define DEV_NUM_PINS 28
#define DEV_PWM_PINS 0xffffffffULL
#define DEV_AIN_PINS 0ULL
// Codal doesn't yet distinguish between PWM and AIN
#define DEV_ANALOG_PINS (DEV_PWM_PINS | DEV_AIN_PINS)
#define CODAL_PIN ZPin
#define CODAL_TIMER ZTimer
#define CODAL_SPI ZSPI
#define CODAL_I2C ZI2C
namespace pxt
{
class ZPin;
class AbstractButton;
class MultiButton;
class CodalComponent;
} // pxt
#define IMAGE_BITS 4
#endif
| [
"michal@moskal.me"
] | michal@moskal.me |
5cc4b633f70ed5c9dcc019d0759c6228a4232018 | 9a28af596b29bbdae5513388cf1304f342f56772 | /src/core/models/reference/individual_reference_likelihood_model.hpp | f2dd9d0ee682b8bf8365f89727f140357aa1fd61 | [
"MIT"
] | permissive | gmagoon/octopus | 20144b7641f2b3242c69595bb211483d74765a24 | 4dc0ad89043514d87e10b3700889b9ae8f620444 | refs/heads/master | 2020-04-14T14:27:08.316570 | 2019-01-02T12:51:24 | 2019-01-02T12:51:24 | 163,897,322 | 0 | 0 | MIT | 2019-01-02T22:45:54 | 2019-01-02T22:45:54 | null | UTF-8 | C++ | false | false | 287 | hpp | // Copyright (c) 2016 Daniel Cooke
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#ifndef individual_reference_likelihood_model_hpp
#define individual_reference_likelihood_model_hpp
namespace octopus {
} // namespace octopus
#endif
| [
"dcooke@well.ox.ac.uk"
] | dcooke@well.ox.ac.uk |
50b936a7311e793dcf776610d9b894134532da69 | b3e7381c6652da54a5c59602a0a5f2ae718b613c | /DigitalClockWindows/ControlBar.cpp | d22dbf42f73d3c262c810ec7dc1cb5c2192cb2ec | [] | no_license | Bytenka/DigitalClock | 3fd6b99d98e8043e782041916467fc43116f1f61 | 32fbac6cc63f75106588cdfbf352ebe62ceccfab | refs/heads/master | 2021-04-27T16:22:04.331129 | 2018-03-01T10:00:36 | 2018-03-01T10:00:36 | 122,487,261 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,442 | cpp | #include <SFML/Graphics.hpp>
#include <iostream>
#include "ControlBar.hpp"
#include "main.hpp"
using namespace std;
ControlBar::ControlBar()
{
this->update();
}
void ControlBar::update()
{
area.left = drawableArea.left;
area.top = drawableArea.top + previewEditor.objectSpace.height + globalBounds + lineBelowPreviewEditor.getSize().y + globalBounds;
area.width = drawableArea.width;
area.height = 100;
startPause.setPosition(sf::Vector2f(
area.width / 2,
area.top
));
stop.setPosition(sf::Vector2f(
area.width / 2,
area.top + startPause.getSize().y
));
minus10.setPosition(sf::Vector2f(
area.width / 2 - startPause.getSize().x / 2 - globalBounds - minus10.getSize().x / 2,
area.top + 5
));
}
void ControlBar::draw(sf::RenderWindow &win)
{
this->update();
// background of the area
sf::RectangleShape r;
r.setPosition(sf::Vector2f(area.left, area.top));
r.setSize(sf::Vector2f(area.width, area.height));
r.setFillColor(sf::Color(0, 0, 127, 100)); // @CUSTOMISATION
/*cout << objectSpace.left << " "
<< objectSpace.width << endl
<< objectSpace.top << " "
<< objectSpace.height << endl
<< r.getPosition().x << " "
<< r.getSize().x << endl
<< r.getPosition().y << " "
<< r.getSize().y << endl
<< endl;*/
win.draw(r);
startPause.draw(win);
stop.draw(win);
minus10.draw(win);
} | [
"slybytenka@gmail.com"
] | slybytenka@gmail.com |
90bc4e7f952103d70c024bafa39e769861a8a825 | ffcc850625b8590866a36d0a607e3a73cf37598d | /test/doc/predicates/is_not_infinite.cpp | 327769dc13b614bb94618d5142dd88ee34ce0d28 | [
"BSL-1.0"
] | permissive | remymuller/boost.simd | af7e596f17294d35ddcd8f859c4a12cb3276254d | c6614f67be94be2608342bf5d753917b6968e821 | refs/heads/develop | 2021-01-02T09:00:18.137281 | 2017-07-06T14:23:04 | 2017-07-06T14:23:04 | 99,120,027 | 6 | 7 | null | 2017-08-02T13:34:55 | 2017-08-02T13:34:55 | null | UTF-8 | C++ | false | false | 1,429 | cpp | //==================================================================================================
/*
Copyright 2017 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//==================================================================================================
//! [is_not_infinite]
#include <boost/simd/predicates.hpp>
#include <boost/simd/pack.hpp>
#include <boost/simd/constant/inf.hpp>
#include <boost/simd/constant/minf.hpp>
#include <boost/simd/constant/nan.hpp>
#include <boost/simd/constant/mindenormal.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 8>;
int main()
{
pack_ft pf = { 0.0f, 1.0f, -1.0f, -2.0f
, bs::Mindenormal<float>(), bs::Inf<float>(), bs::Minf<float>(), bs::Nan<float>() };
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::is_not_infinite(pf) = " << bs::is_not_infinite(pf) << '\n';
float xf = 1.0f;
float yf = bs::Mindenormal<float>();
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::is_not_infinite(xf) = " << bs::is_not_infinite(xf) << '\n'
<< "<- yf = " << yf << '\n'
<< "-> bs::is_not_infinite(yf) = " << bs::is_not_infinite(yf) << '\n';
return 0;
}
//! [is_not_infinite]
| [
"joel.falcou@lri.fr"
] | joel.falcou@lri.fr |
27b93dc0a45ca244e5244d0025db2c44f9f1ad1b | b6b922afd769105760125d76228e7ba974be8fdb | /daemon/index_float.h | 281ec8aac6cad9fcec1fceea7ea129661f4d6cb8 | [
"BSD-3-Clause"
] | permissive | AaronFriel/HyperDex | ddec1dec4b9bdbae0341977b2a1056b7660a8672 | e34af2b81812009d75e4ad325b4c732f274edc92 | refs/heads/master | 2020-12-25T02:51:02.947950 | 2013-06-11T16:27:35 | 2013-06-13T18:42:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,246 | h | // Copyright (c) 2013, Cornell University
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of HyperDex nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#ifndef hyperdex_daemon_index_float_h_
#define hyperdex_daemon_index_float_h_
// HyperDex
#include "daemon/index_primitive.h"
namespace hyperdex
{
class index_float : public index_primitive
{
public:
index_float();
virtual ~index_float() throw ();
public:
virtual bool encoding_fixed();
virtual size_t encoded_size(const e::slice& decoded);
virtual char* encode(const e::slice& decoded, char* encoded);
virtual size_t decoded_size(const e::slice& encoded);
virtual char* decode(const e::slice& encoded, char* decoded);
};
} // namespace hyperdex
#endif // hyperdex_daemon_index_float_h_
| [
"me@robescriva.com"
] | me@robescriva.com |
9e667ab2ece715f0dcad6acda8fc9d7337a7e724 | e31fbda3dcf4c525ca670832a88ef2fae224119a | /thread_learn/thread_learn/Source.cpp | 9447ccaad2d25d61f757deca2b2962c0f4808d60 | [] | no_license | wcatp19891104/Leetcode | cb767261c0faed43ef0992adeaf4dd7cfc3a378f | e119f9902eeaa1091cc69040a386619e1775d328 | refs/heads/master | 2020-04-15T16:12:19.474929 | 2014-10-08T21:08:04 | 2014-10-08T21:08:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 800 | cpp | // lock_guard example
#include <iostream> // std::cout
#include <thread> // std::thread
#include <mutex> // std::mutex, std::lock_guard
#include <stdexcept> // std::logic_error
std::mutex mtx;
void print_even(int x) {
if (x % 2 == 0) std::cout << x << " is even\n";
else throw (std::logic_error("not even"));
}
void print_thread_id(int id) {
try {
// using a local lock_guard to lock mtx guarantees unlocking on destruction / exception:
std::lock_guard<std::mutex> lck(mtx);
print_even(id);
}
catch (std::logic_error&) {
std::cout << "[exception caught]\n";
}
}
int main()
{
std::thread threads[10];
// spawn 10 threads:
for (int i = 0; i<10; ++i)
threads[i] = std::thread(print_thread_id, i + 1);
for (auto& th : threads) th.join();
return 0;
} | [
"wcatp19891104@gmail.com"
] | wcatp19891104@gmail.com |
076c2e559439937f70e3ad0d71ed179fee4abfdb | 39e348a6cfdc365a49b03695a3a86f92aa72fd2b | /C++/AccountAgain/GuanErDai.cpp | 6ad5e277e5659c48e3df9ef51d680218737f6d69 | [] | no_license | qiuyongchen/code_saver | fd646e969774b190d764f709c4233e6283af84f1 | afbec799e72901e85e9434bbe3cc745d9735fc6f | refs/heads/master | 2021-01-10T04:48:00.349287 | 2016-02-21T04:18:52 | 2016-02-21T04:18:52 | 45,052,084 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 505 | cpp | #include "GuanErDai.h"
#include <iostream>
using namespace std;
GuanErDai::GuanErDai() {
name_ = "";
}
GuanErDai::GuanErDai(const string& name, const string& dadName, double balance)
:Account(dadName, balance) {
name_ = name;
}
string GuanErDai::getName() const {
return name_;
}
double GuanErDai::getBalance() const {
return Account::getBalance();
}
void GuanErDai::setName(string name) {
name_ = name;
}
void GuanErDai::setBalance(double balance) {
Account::setBalance(balance);
}
| [
"qiuych3@mail2.sysu.edu.cn"
] | qiuych3@mail2.sysu.edu.cn |
2dc93bc6c35af7c49a22cdb40a312166b216d535 | c24b07fb7583748056927bc1bfcb32666520c392 | /C/src/whattotest.cpp | c59e6ce58d84a2004801a5574335a47fd8a39b82 | [] | no_license | aseemm/sandbox | 2350b7fc774e42ac89398b868bf2c1b6f5fdd244 | 2b83abcaee6c77afc1afc23dc89085a8f22eaf38 | refs/heads/master | 2022-11-15T19:25:35.273430 | 2022-10-20T22:11:08 | 2022-10-20T22:11:08 | 22,887,039 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 174 | cpp | #include <math.h>
double squareRoot(const double a) {
double b = sqrt(a);
if(b != b) { // nan check
return -1.0;
}else{
return sqrt(a);
}
}
| [
"aseemm@gmail.com"
] | aseemm@gmail.com |
251adbc744f732ed93d6fd8de6995366ee9dcb11 | 835934c3035770bd2fb0cea752bbe5c93b8ddc83 | /VTKHeaders/vtkMPI.h | 924d17edc167317c90bf21c1178da88d2ce6df4c | [
"MIT"
] | permissive | jmah/OsiriX-Quad-Buffered-Stereo | d257c9fc1e9be01340fe652f5bf9d63f5c84cde1 | 096491358a5d4d8a0928dc03d7183ec129720c56 | refs/heads/master | 2016-09-05T11:08:48.274221 | 2007-05-02T15:06:45 | 2007-05-02T15:06:45 | 3,008,660 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 932 | h | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkMPI.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef __vtkMPI_h
#define __vtkMPI_h
#include "mpi.h"
#include "vtkSystemIncludes.h"
class VTK_PARALLEL_EXPORT vtkMPICommunicatorOpaqueComm
{
public:
vtkMPICommunicatorOpaqueComm();
MPI_Comm* GetHandle();
friend class vtkMPICommunicator;
friend class vtkMPIController;
protected:
MPI_Comm* Handle;
};
#endif // __vtkMPI_h
| [
"me@JonathonMah.com"
] | me@JonathonMah.com |
d5183a2157015485efb269684dc5b52b59194e12 | bd3f3a0ab9e18d84bd6d5c546d0620fc7209dc05 | /portConversor.hpp | f117476cee0963a7fd087e68a4613bb195ebe75b | [] | no_license | Evan-xia-mew/4001 | b979bb8d2d67a8737af7e62e5c599a0d801fe104 | 3e7504d73bb28599784f8c6038443922c648306f | refs/heads/master | 2020-03-09T00:40:40.367988 | 2018-04-07T03:54:14 | 2018-04-07T03:54:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,647 | hpp |
#ifndef BOOST_SIMULATION_PDEVS_BM_PORT_CONVERSOR_H
#define BOOST_SIMULATION_PDEVS_BM_PORT_CONVERSOR_H
#include <string>
#include <iostream>
#include <vector>
#include <assert.h>
#include <boost/simulation/pdevs/atomic.hpp>
#include "../data_structures/message.hpp"
#include "../vendor/britime.hpp"
#include <random>
using namespace boost::simulation::pdevs;
using namespace boost::simulation;
using namespace std;
template<class TIME, class MSG>
class portConversor : public pdevs::atomic<TIME, MSG> {
private:
string id;
vector <MSG> msg_port_converted;
public:
explicit portConversor(string Id) noexcept {
id = Id;
msg_port_converted.clear();
}
void internal() noexcept {
msg_port_converted.clear();
}
TIME advance() const noexcept {
TIME next_internal;
if (msg_port_converted.empty()){
next_internal = pdevs::atomic<TIME, MSG>::infinity;
}else{
next_internal = 0;
}
return next_internal;
}
vector<MSG> out() const noexcept {
vector<MSG> out_put;
if(msg_port_converted.empty()){
out_put.clear();
}else {
out_put = msg_port_converted;
}
return out_put;
}
void external(const vector<MSG>& mb, const TIME& t) noexcept {
MSG aux;
for (int i = 0; i<mb.size(); i++){
aux = mb[i];
aux.port = id;
msg_port_converted.push_back(aux);
}
}
void confluence(const vector<MSG>& mb, const TIME& t) noexcept {
internal();
external(mb, 0);
}
};
#endif // BOOST_SIMULATION_PDEVS_BM_PORT_CONVERSOR_H
| [
"lovesomuns@gmail.com"
] | lovesomuns@gmail.com |
a45a37f37ac7e842edcce3bc0f822badaad615e7 | 623d3fdaaa7e5fd2d4b6dd7d2d0b7d076f939d26 | /FeLiNa/ResourceScript.cpp | 6ba1ca93a3077c8c636adb3856a0a601bb681066 | [
"MIT",
"LicenseRef-scancode-other-permissive"
] | permissive | Acaree/FeLiNa-Engine | 606457ba427b7c9738df49405cd25d165648ffad | c2af3e6560797a3a587fafeef15ce064defbcad8 | refs/heads/master | 2020-03-28T21:35:47.920704 | 2018-12-23T21:48:36 | 2018-12-23T21:48:36 | 149,168,172 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 436 | cpp | #include "ResourceScript.h"
ResourceScript::ResourceScript(uint uid, RESOURCE_TYPE type) : Resource(uid, type)
{
}
ResourceScript::~ResourceScript()
{
RELEASE(graph);
}
bool ResourceScript::LoadInMemory()
{
graph = new NodeGraph(uid, exported_file.substr(0,exported_file.find(EXTENSION_SCRIPT)).c_str());
graph->LoadGraph(file.c_str());
return true;
}
bool ResourceScript::EraseInMemory()
{
RELEASE(graph);
return true;
} | [
"alfonsosanchez1896@gmail.com"
] | alfonsosanchez1896@gmail.com |
30ee08a483bfd1ab86699a7a8efbcf6e13d19fce | 023527a24d27b49574ecb2bb1bc09a0ede1643ab | /2017/August/Next Permutation.cpp | 90249f70584e00f437a0105d692c3719b9654d95 | [] | no_license | maocaixia/LeetCode | bc0f3a28fe87a7fbb134b9561b447a0640fc48bc | ed576aad8fb14d5f2a148ab8eb737dbb117202d4 | refs/heads/master | 2020-12-30T11:02:23.726075 | 2017-10-01T15:02:29 | 2017-10-01T15:02:29 | 98,838,197 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,326 | cpp | /*********************
问题描述
**********************
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
The replacement must be in-place, do not allocate extra memory.
Here are some examples. Inputs are in the left-hand column and its corresponding outputs are in the right-hand column.
1,2,3 → 1,3,2
3,2,1 → 1,2,3
1,1,5 → 1,5,1
**********************
reverse()用法
http://imyon.github.io/cpp/2014/01/11/c++-reverse()%E5%87%BD%E6%95%B0%E7%9A%84%E7%94%A8%E6%B3%95
**********************
问题解答
**********************
**********************/
class Solution {
public:
void nextPermutation(vector<int>& nums) {
int n = nums.size();
int k = -1;
for(int i=n-2; i>=0; i--){
if(nums[i]<nums[i+1]){
k = i;
break;
}
}
if(k == -1){
reverse(nums.begin(),nums.end());
return;
}
for(int i=n-1; i>=0; i--){
if(nums[i] > nums[k]){
swap(nums[i],nums[k]);
break;
}
}
reverse(nums.begin()+k+1,nums.end());
}
};
| [
"noreply@github.com"
] | noreply@github.com |
b46327943fd16ceab05bfd4af449d050d045a088 | c298cf993d45242445848aeea5ac2fe8d3bf7c68 | /Checkup.cpp | 9861ffe6b53a66b8ff8c06e049783c97eaeaf194 | [] | no_license | AFRIKAKORPS1/cse240h9 | e6a014e8b29c1292dd7d977ddfa66cfa7a15239d | 970b28b38166e834b3291e7b87c6a25e97a9908f | refs/heads/master | 2021-01-12T16:05:25.463183 | 2016-10-25T19:59:56 | 2016-10-25T19:59:56 | 71,933,918 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 130 | cpp | #include "Checkup.h"
Checkup::Checkup(string new_date) {
date = new_date;
}
string Checkup::getDate() {
return date;
} | [
"noreply@github.com"
] | noreply@github.com |
9b5ff7b4e516926a33a5b124f353e9b1dfb592ac | 9dd4240f805e91a1e51cc7db956a10765a2cfcc2 | /code/1010.cpp | bfe06acea0a5411c7d7738653a5cd2fdd19a1441 | [] | no_license | murdercdh/PKU_ACM | 7d42b06a55cdd84ed97b7963c473c075ff9812f4 | 9db1a47cf4563dd96314e1323c3f83d40685d66c | refs/heads/master | 2021-01-17T21:40:38.631438 | 2012-09-20T19:27:30 | 2012-09-20T19:27:30 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,243 | cpp | #include <iostream>
using namespace std;
int stamp[100],use[100],best[5];
int t,total,bestmax,bestnum,maxvalue,type;
bool tie;
bool compare()
{
int counttype=0,findmax=0,findnum=0;
for(int i=1;i<=stamp[0];++i)
{
if(use[i]!=0)
{
counttype++,findnum+=use[i];
if(stamp[i]>findmax)
findmax=stamp[i];
}
}
if(counttype>type)
{
type=counttype;
bestmax=findmax;
bestnum=findnum;
tie=false;
return true;
}
else if(counttype==type)
{
if(findnum<bestnum)
{
bestmax=findmax;
bestnum=findnum;
tie=false;
return true;
}
else if(findnum==bestnum)
{
if(findmax>bestmax)
{
bestmax=findmax;
tie=false;
return true;
}
else if(findmax==bestmax)
{
tie=true;
return false;
}
}
}
return false;
}
void copyresult()
{
for(int i=0;i<5;++i)
best[i]=0;
int k=0;
for(int i=1;i<=stamp[0];++i)
{
if(use[i]!=0)
{
for(int j=0;j<use[i];++j)
best[k++]=stamp[i];
}
}
}
void search(int money,int now)
{
for(int i=now;i<=stamp[0];++i)
{
if(money-stamp[i]>0&&total<4)
{
total++;
money-=stamp[i];
use[i]++;
search(money,i);
use[i]--;
money+=stamp[i];
total--;
}
else if(money-stamp[i]==0&&total<4) // 钱用光,比较最优值
{
use[i]++,total++;
if(compare())
{
copyresult();
}
use[i]--,total--;
}
}
}
void out()
{
cout << " (" << type << "):";
int k=0;
while(best[k]!=0)
k++;
if(tie)
cout << " tie";
else
for(int i=0;i<k;++i)
cout << " " << best[i];
cout << endl;
}
bool prune()
{
if(t<=4*maxvalue)
return true;
else
{
cout << " ---- none" << endl;
return false;
}
}
void initialize()
{
maxvalue=0;
for(int i=1;i<=stamp[0];++i)
{
use[i]=0;
if(maxvalue<stamp[i])
maxvalue=stamp[i];
}
total=0,tie=false,bestmax=0,bestnum=0,type=0;
}
int main()
{
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
while(cin >> t)
{
memset(stamp,0,sizeof(stamp));
stamp[0]=0,stamp[1]=t;
while(t!=0)
{
stamp[0]++;
stamp[stamp[0]]=t;
cin >> t;
}
cin >> t;
while(t!=0)
{
cout << t;
initialize();
if(prune())
{
search(t,1);
if(type!=0)
out();
else
cout << " ---- none" << endl;
}
cin >> t;
}
}
return 0;
} | [
"ljw7630@hotmail.com"
] | ljw7630@hotmail.com |
c13be89b5b04c40be26a1bcc4ccd8bfda31c4baa | 4a043e9029946d4cceaea319065729532b83687f | /src/METAnalyzerPAT.cc | b91f735a0191bd89df177b46651d86cd18a2347e | [] | no_license | jsturdy/analysis-ntuple-pat | dd6dec4e8a406052b9dcc48ed4a7a6be719fed6e | 4a00fb7ec93f9200e7c32789709d9090dbd51bc1 | refs/heads/master | 2021-01-15T17:42:09.227944 | 2014-01-31T15:38:10 | 2014-01-31T15:38:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,278 | cc |
// -*- C++ -*-
//
// Package: AnalysisNtuplePAT
// Class: METAnalyzerPAT
//
/**\class METAnalyzerPAT METAnalyzerPAT.cc JSturdy/AnalysisNtuplePAT/src/METAnalyzerPAT.cc
*/
//
// Original Author: Jared Sturdy
// Created: Tue Feb 2 12:11:44 PDT 2010
// $Id: METAnalyzerPAT.cc,v 1.14 2011/03/18 10:58:50 sturdy Exp $
//
//
#include "JSturdy/AnalysisNtuplePAT/interface/METAnalyzerPAT.h"
#include <TMath.h>
//________________________________________________________________________________________
METAnalyzerPAT::METAnalyzerPAT(const edm::ParameterSet& metParams, TTree* mMETData)
:
mep4 (new reco::Candidate::LorentzVector ),
//corrX (new std::map<std::string,doubld> ),
//corrY (new std::map<std::string,doubld> ),
//corrSumET (new std::map<std::string,doubld> ),
//corrMETPhi (new std::map<std::string,doubld> ),
//corrPt (new std::map<std::string,doubld> ),
//genMETP4 (new reco::Candidate::LorentzVector ),
genTrueMETP4(new reco::Candidate::LorentzVector ),
genCaloMETP4(new reco::Candidate::LorentzVector )
{
debug_ = metParams.getUntrackedParameter<int>("debugMET",0);
prefix_ = metParams.getUntrackedParameter<std::string>("prefixMET","Calo");
doMCData_ = metParams.getUntrackedParameter<bool>("doMCMET",false);
// get the data tags
metTag_ = metParams.getUntrackedParameter<edm::InputTag>("metTag");
useCaloMET_ = metParams.getUntrackedParameter<bool>("doCaloMET",false);
usePFMET_ = metParams.getUntrackedParameter<bool>("doPFMET", false);
localPi = acos(-1.0);
// Initialise plots [should improve in the future]
bookTTree(mMETData);
}
//________________________________________________________________________________________
METAnalyzerPAT::~METAnalyzerPAT() {
//delete mMETData;
}
//
//________________________________________________________________________________________
void METAnalyzerPAT::beginRun(const edm::Run& run, const edm::EventSetup&es)
{
}
//________________________________________________________________________________________
// Method called to for each event
bool METAnalyzerPAT::filter(const edm::Event& ev, const edm::EventSetup& es)
{
using namespace reco;
using namespace edm;
bool isData_ = ev.isRealData();
maintenance();
met_result = true;
edm::LogVerbatim("AnalysisNtuplePAT::METAnalyzerPAT") << " Start " << std::endl;
edm::Handle< std::vector<pat::MET> > metHandle;
ev.getByLabel(metTag_, metHandle);
if ( !metHandle.isValid() ) {
edm::LogWarning("METEventSelector") << "No Met results for InputTag " << metTag_;
return false;
}
if ( metHandle->size()!=1 ) {
edm::LogWarning("METEventSelector") << "MET collection size is "
<< metHandle->size() << " instead of 1";
return false;
}
const pat::MET& theMET = metHandle->front();
(*mep4) = theMET.p4();
//double melong = theMET.e_longitudinal();
double met = theMET.et();
double mex = theMET.momentum().X();
double mey = theMET.momentum().Y();
double mez = theMET.momentum().z();
double metphi = theMET.phi();
double sumet = theMET.sumEt();
double metsig = theMET.mEtSig();
// Do the MET save for full corr no cc MET
m_MET_Fullcorr[0] = mex;
m_MET_Fullcorr[1] = mey;
m_MET_Fullcorr[2] = mez;
m_METpt_Fullcorr = met;
m_METphi_Fullcorr = metphi;
m_METsumEt_Fullcorr = sumet;
m_METsignificance_Fullcorr = metsig;
if (theMET.isCaloMET()) {
METmaxEt_em = theMET.maxEtInEmTowers();
METmaxEt_had = theMET.maxEtInHadTowers();
METetFrac_had = theMET.etFractionHadronic();
METetFrac_em = theMET.emEtFraction();
METmetSig = theMET.metSignificance();
}
if (theMET.isPFMET()) {
METFrac_neutralEM = theMET.NeutralEMFraction();
METFrac_neutralHad = theMET.NeutralHadEtFraction();
METFrac_chargedEM = theMET.ChargedEMEtFraction();
METFrac_chargedHad = theMET.ChargedHadEtFraction();
METFrac_muon = theMET.MuonEtFraction();
METFrac_type6 = theMET.Type6EtFraction();
METFrac_type7 = theMET.Type7EtFraction();
}
if (debug_>5) std::cout<<"Number of corrections applied to MET object "<<metTag_<<" "<<theMET.nCorrections()<<std::endl;
// Do the MET save for no corr no cc MET
m_MET_Nocorr[0] = theMET.corEx(pat::MET::uncorrALL);
m_MET_Nocorr[1] = theMET.corEy(pat::MET::uncorrALL);
m_METsumEt_Nocorr = theMET.corSumEt(pat::MET::uncorrALL);
m_METpt_Nocorr = theMET.uncorrectedPt(pat::MET::uncorrALL);
m_METphi_Nocorr = theMET.uncorrectedPhi(pat::MET::uncorrALL);
// Do the MET save for muon corr no cc MET
// i.e., remove JES corrections
m_MET_Muoncorr[0] = theMET.corEx(pat::MET::uncorrJES);
m_MET_Muoncorr[1] = theMET.corEy(pat::MET::uncorrJES);
m_METsumEt_Muoncorr = theMET.corSumEt(pat::MET::uncorrJES);
m_METpt_Muoncorr = theMET.uncorrectedPt(pat::MET::uncorrJES);
m_METphi_Muoncorr = theMET.uncorrectedPhi(pat::MET::uncorrJES);
// Do the MET save for JES corr no cc MET
// i.e., remove muon corrections
m_MET_JEScorr[0] = theMET.corEx(pat::MET::uncorrMUON);
m_MET_JEScorr[1] = theMET.corEy(pat::MET::uncorrMUON);
m_METsumEt_JEScorr = theMET.corSumEt(pat::MET::uncorrMUON);
m_METpt_JEScorr = theMET.uncorrectedPt(pat::MET::uncorrMUON);
m_METphi_JEScorr = theMET.uncorrectedPhi(pat::MET::uncorrMUON);
//
// sanity check on collection
//
nUncorrMET = 2;
nFullMET = 3;
//Gen level MET
if (!isData_) {
if (doMCData_) {
edm::Handle<reco::GenMETCollection> genMetCaloHandle;
ev.getByLabel("genMetCalo", genMetCaloHandle);
if ( !genMetCaloHandle.isValid() ) {
edm::LogWarning("METEventSelector") << "No genMetCalo results";
return false;
}
const reco::GenMET& genMETCalo = genMetCaloHandle->front();
// sanity check on collection
if ( genMetCaloHandle->size()!=1 ) {
edm::LogWarning("METEventSelector") << "MET collection size is "
<< genMetCaloHandle->size() << " instead of 1";
return false;
}
if ( genMetCaloHandle.isValid() ) {
(*genCaloMETP4) = genMETCalo.p4();
m_METGenCalo[0] = genMETCalo.px();
m_METGenCalo[1] = genMETCalo.py();
m_METGenCalo[2] = genMETCalo.pz();
genCaloSumEt = genMETCalo.sumEt();
genCaloMetSig = genMETCalo.mEtSig();
genCaloSignificance = genMETCalo.significance();
}
edm::Handle<reco::GenMETCollection> genMetTrueHandle;
ev.getByLabel("genMetTrue", genMetTrueHandle);
if ( !genMetTrueHandle.isValid() ) {
edm::LogWarning("METEventSelector") << "No genMetTrue results";
return false;
}
// sanity check on collection
if ( genMetTrueHandle->size()!=1 ) {
edm::LogWarning("METEventSelector") << "genMetTrue collection size is "
<< genMetTrueHandle->size() << " instead of 1";
return false;
}
const reco::GenMET& genMETTrue = genMetTrueHandle->front();
if ( genMetTrueHandle.isValid() ) {
(*genTrueMETP4) = genMETTrue.p4();
m_METGenTrue[0] = genMETTrue.px();
m_METGenTrue[1] = genMETTrue.py();
m_METGenTrue[2] = genMETTrue.pz();
genTrueSumEt = genMETTrue.sumEt();
genTrueMetSig = genMETTrue.mEtSig();
genTrueSignificance = genMETTrue.significance();
}
////Gen MET from the PAT MET object
//if(theMET.genMET()!=NULL) {
// const reco::GenMET* myGenMet = theMET.genMET();
// genMETP4 = myGenMet->p4();
// m_METGen[0] = myGenMet->px();
// m_METGen[1] = myGenMet->py();
// m_METGen[2] = myGenMet->pz();
// genSumEt = myGenMet->sumEt();
// genMetSig = myGenMet->mEtSig();
// genSignificance = myGenMet->significance();
//}
//else{
// genMETP4.SetPxPyPzE(-9999,-9999,-9999,-9999);
// m_METGen[0] = -9999;
// m_METGen[1] = -9999;
// m_METGen[2] = -9999;
// genSumEt = -9999;
// genMetSig = -9999;
// genSignificance = -9999;
//}
}
}
// Fill the tree only if all preselection conditions are met
if (debug_)
std::cout<<"Done analyzing MET"<<std::endl;
return met_result;
}
//________________________________________________________________________________________
void METAnalyzerPAT::bookTTree(TTree* mMETData) {
// Add the branches
//general MET information
mMETData->Branch("nFull"+prefix_+"MET", &nFullMET, "nFull"+prefix_+"MET/I");
mMETData->Branch("nUncorr"+prefix_+"MET", &nUncorrMET, "nUncorr"+prefix_+"MET/I");
mMETData->Branch(prefix_+"METP4", &(*mep4.get() ));
//mMETData->Branch(prefix_+"MET_Fullcorr", m_MET_Fullcorr, prefix_+"MET_Fullcorr[nFull"+prefix_+"MET]/D");
//mMETData->Branch(prefix_+"METpt_Fullcorr", &m_METpt_Fullcorr, prefix_+"METpt_Fullcorr/D");
//mMETData->Branch(prefix_+"METphi_Fullcorr", &m_METphi_Fullcorr, prefix_+"METphi_Fullcorr/D");
mMETData->Branch(prefix_+"METsumEt_Fullcorr", &m_METsumEt_Fullcorr, prefix_+"METsumEt_Fullcorr/D");
mMETData->Branch(prefix_+"METsignificance_Fullcorr", &m_METsignificance_Fullcorr, prefix_+"METsignificance_Fullcorr/D");
if (useCaloMET_) {
mMETData->Branch(prefix_+"METmaxEt_em" , &METmaxEt_em , prefix_+"METmaxEt_em/D" );
mMETData->Branch(prefix_+"METmaxEt_had" , &METmaxEt_had , prefix_+"METmaxEt_had/D" );
mMETData->Branch(prefix_+"METetFrac_em" , &METetFrac_em , prefix_+"METetFrac_em/D" );
mMETData->Branch(prefix_+"METetFrac_had", &METetFrac_had, prefix_+"METetFrac_had/D" );
mMETData->Branch(prefix_+"METmetSig", &METmetSig , prefix_+"METmetSig/D" );
}
if (usePFMET_) {
mMETData->Branch(prefix_+"METFrac_neutralEM" , &METFrac_neutralEM , prefix_+"METFrac_neutralEM/D" );
mMETData->Branch(prefix_+"METFrac_neutralHad", &METFrac_neutralHad, prefix_+"METFrac_neutralHad/D" );
mMETData->Branch(prefix_+"METFrac_chargedEM" , &METFrac_chargedEM , prefix_+"METFrac_chargedEM/D" );
mMETData->Branch(prefix_+"METFrac_chargedHad", &METFrac_chargedHad, prefix_+"METFrac_chargedHad/D" );
mMETData->Branch(prefix_+"METFrac_muon" , &METFrac_muon , prefix_+"METFrac_muon/D" );
mMETData->Branch(prefix_+"METFrac_type6" , &METFrac_type6 , prefix_+"METFrac_type6/D" );
mMETData->Branch(prefix_+"METFrac_type7" , &METFrac_type7 , prefix_+"METFrac_type7/D" );
}
mMETData->Branch(prefix_+"MET_Nocorr", m_MET_Nocorr, prefix_+"MET_Nocorr[nUncorr"+prefix_+"MET]/D");
mMETData->Branch(prefix_+"METpt_Nocorr", &m_METpt_Nocorr, prefix_+"METpt_Nocorr/D");
mMETData->Branch(prefix_+"METphi_Nocorr", &m_METphi_Nocorr, prefix_+"METphi_Nocorr/D");
mMETData->Branch(prefix_+"METsumEt_Nocorr", &m_METsumEt_Nocorr, prefix_+"METsumEt_Nocorr/D");
mMETData->Branch(prefix_+"MET_Muoncorr", m_MET_Muoncorr, prefix_+"MET_Muoncorr[nUncorr"+prefix_+"MET]/D");
mMETData->Branch(prefix_+"METpt_Muoncorr", &m_METpt_Muoncorr, prefix_+"METpt_Muoncorr/D");
mMETData->Branch(prefix_+"METphi_Muoncorr", &m_METphi_Muoncorr, prefix_+"METphi_Muoncorr/D");
mMETData->Branch(prefix_+"METsumEt_Muoncorr", &m_METsumEt_Muoncorr, prefix_+"METsumEt_Muoncorr/D");
mMETData->Branch(prefix_+"MET_JEScorr", m_MET_JEScorr, prefix_+"MET_JEScorr[nUncorr"+prefix_+"MET]/D");
mMETData->Branch(prefix_+"METpt_JEScorr", &m_METpt_JEScorr, prefix_+"METpt_JEScorr/D");
mMETData->Branch(prefix_+"METphi_JEScorr", &m_METphi_JEScorr, prefix_+"METphi_JEScorr/D");
mMETData->Branch(prefix_+"METsumEt_JEScorr", &m_METsumEt_JEScorr, prefix_+"METsumEt_JEScorr/D");
if (doMCData_) {
//mMETData->Branch(prefix_+"GenMET", &m_METGen, prefix_+"GenMET[3]/D");
//mMETData->Branch(prefix_+"GenSumEt", &genSumEt, prefix_+"GenSumEt/D");
//mMETData->Branch(prefix_+"GenMetSig", &genMetSig, prefix_+"GenMetSig/D");
//mMETData->Branch(prefix_+"GenSignificance", &genSignificance, prefix_+"GenSignificance/D");
//mMETData->Branch(prefix_+"GenMETP4", &(*genMETP4.get() ));
mMETData->Branch("GenMETTrue", m_METGenTrue, "GenMETTrue[3]/D");
mMETData->Branch("GenTrueSumEt", &genTrueSumEt, "GenTrueSumEt/D");
mMETData->Branch("GenTrueMetSig", &genTrueMetSig, "GenTrueMetSig/D");
mMETData->Branch("GenTrueSignificance", &genTrueSignificance, "GenTrueSignificance/D");
mMETData->Branch("GenTrueMETP4", &(*genTrueMETP4.get() ));
mMETData->Branch("GenMETCalo", m_METGenCalo, "GenMETCalo[3]/D");
mMETData->Branch("GenCaloSumEt", &genCaloSumEt, "GenCaloSumEt/D");
mMETData->Branch("GenCaloMetSig", &genCaloMetSig, "GenCaloMetSig/D");
mMETData->Branch("GenCaloSignificance", &genCaloSignificance, "GenCaloSignificance/D");
mMETData->Branch("GenCaloMETP4", &(*genCaloMETP4.get() ));
}
}
//_______________________________________________________________________________________
// Define this as a plug-in
//#include "FWCore/Framework/interface/MakerMacros.h"
//DEFINE_FWK_MODULE(METAnalyzerPAT);
| [
""
] | |
f2307070cdac4df282afcd6589f8c6fae4ec429a | f49dccaf5925938b3d66a01d1c73e906b2d82f76 | /list6/list6_counter.cpp | 040ce53f372fa3136876a3eb91841c627c4ce0ad | [] | no_license | kawai-akira836/c-learning | 2f6c18f543539d190237165c858dbe39cd43c2f5 | 0e29866e2a22dc707e746c420d276e8d333bf5cf | refs/heads/master | 2020-04-14T01:10:48.161731 | 2019-01-12T11:13:05 | 2019-01-12T11:13:05 | 163,553,502 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 866 | cpp | #include <iostream>
using namespace std;
//10個のカウンタの値
int counterVal[10];
//引数で指定されたカウンタの値を0にする関数
void resetCounterVal(int num) {
counterVal[num] = 0;
}
//引数で指定されたカウンタの値をアップする関数
void upCounterVal(int num) {
counterVal[num]++;
}
//main関数
int main(int argc, char const *argv[]) {
//3番と5番のカウンタをリセットする
resetCounterVal(3);
resetCounterVal(5);
//3番を2回アップする
upCounterVal(3);
upCounterVal(3);
//5番を4回アップする
upCounterVal(5);
upCounterVal(5);
upCounterVal(5);
upCounterVal(5);
//それぞれの値を画面に表示する
cout << "3番のカウンタの値 = " << counterVal[3] << endl;
cout << "5番のカウンタの値 = " << counterVal[5] << endl;
return 0;
}
| [
"kawai@kawaiakiranoMacBook-ea.local"
] | kawai@kawaiakiranoMacBook-ea.local |
1c5cb9331d1395290bcde67028ddb6e5d42005d2 | b29490a0e39313a924fc52af7a420b7a7f2449e5 | /examples/code/render_target/render_target.cpp | 714bdad308d66319a1a4790631a033634f0fd6a0 | [
"MIT"
] | permissive | heitaoflower/pmtech | 29bcba253054059609f2059defdf13ac180e1976 | 7975acdf6f3d442f70dc5b9fe7ea563bbb2109fe | refs/heads/master | 2020-12-09T17:15:43.062358 | 2020-04-27T05:21:05 | 2020-04-27T05:21:05 | 233,368,223 | 0 | 0 | MIT | 2020-04-27T05:21:06 | 2020-01-12T09:32:29 | C++ | UTF-8 | C++ | false | false | 8,110 | cpp | #include "file_system.h"
#include "loader.h"
#include "memory.h"
#include "pen.h"
#include "pen_string.h"
#include "pmfx.h"
#include "renderer.h"
#include "threads.h"
#include "timer.h"
using namespace put;
void* pen::user_entry(void* params);
namespace pen
{
pen_creation_params pen_entry(int argc, char** argv)
{
pen::pen_creation_params p;
p.window_width = 1280;
p.window_height = 720;
p.window_title = "render_target";
p.window_sample_count = 4;
p.user_thread_function = user_entry;
p.flags = pen::e_pen_create_flags::renderer;
return p;
}
} // namespace pen
typedef struct vertex
{
float x, y, z, w;
} vertex;
typedef struct textured_vertex
{
float x, y, z, w;
float u, v;
} textured_vertex;
void* pen::user_entry(void* params)
{
// unpack the params passed to the thread and signal to the engine it ok to proceed
pen::job_thread_params* job_params = (pen::job_thread_params*)params;
pen::job* p_thread_info = job_params->job_info;
pen::semaphore_post(p_thread_info->p_sem_continue, 1);
// create 2 clear states one for the render target and one for the main screen, so we can see the difference
static pen::clear_state cs = {
0.5f, 0.0, 0.5f, 1.0f, 1.0f, 0x00, PEN_CLEAR_COLOUR_BUFFER | PEN_CLEAR_DEPTH_BUFFER,
};
u32 clear_state = pen::renderer_create_clear_state(cs);
static pen::clear_state cs_rt = {
0.0f, 0.0, 0.5f, 1.0f, 1.0f, 0x00, PEN_CLEAR_COLOUR_BUFFER | PEN_CLEAR_DEPTH_BUFFER,
};
u32 clear_state_rt = pen::renderer_create_clear_state(cs_rt);
// raster state
pen::rasteriser_state_creation_params rcp;
pen::memory_zero(&rcp, sizeof(rasteriser_state_creation_params));
rcp.fill_mode = PEN_FILL_SOLID;
rcp.cull_mode = PEN_CULL_NONE;
rcp.depth_bias_clamp = 0.0f;
rcp.sloped_scale_depth_bias = 0.0f;
u32 raster_state = pen::renderer_create_rasterizer_state(rcp);
// viewport
pen::viewport vp = {0.0f, 0.0f, 1280.0f, 720.0f, 0.0f, 1.0f};
// viewport for render target
pen::viewport vp_rt = {0.0f, 0.0f, 1024.0f, 512.0f, 0.0f, 1.0f};
// create render target
pen::texture_creation_params tcp = {0};
tcp.width = (u32)vp_rt.width;
tcp.height = (u32)vp_rt.height;
tcp.cpu_access_flags = 0;
tcp.format = PEN_TEX_FORMAT_RGBA8_UNORM;
tcp.num_arrays = 1;
tcp.num_mips = 1;
tcp.bind_flags = PEN_BIND_RENDER_TARGET | PEN_BIND_SHADER_RESOURCE;
tcp.pixels_per_block = 1;
tcp.sample_count = 1;
tcp.sample_quality = 0;
tcp.block_size = 32;
tcp.usage = PEN_USAGE_DEFAULT;
tcp.flags = 0;
u32 colour_render_target = pen::renderer_create_render_target(tcp);
// load shaders now requiring dependency on pmfx to make loading simpler.
u32 basic_tri_shader = pmfx::load_shader("basictri");
u32 textured_shader = pmfx::load_shader("textured");
// create vertex buffer for a triangle
vertex triangle_vertices[] = {
-0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.5f, 0.5f, 1.0f, 0.5f, -0.5f, 0.5f, 1.0f,
};
pen::buffer_creation_params bcp;
bcp.usage_flags = PEN_USAGE_DEFAULT;
bcp.bind_flags = PEN_BIND_VERTEX_BUFFER;
bcp.cpu_access_flags = 0;
bcp.buffer_size = sizeof(vertex) * 3;
bcp.data = (void*)&triangle_vertices[0];
u32 triangle_vertex_buffer = pen::renderer_create_buffer(bcp);
f32 uv_y_a = 1.0f;
f32 uv_y_b = 0.0f;
// create vertex buffer for a quad
textured_vertex quad_vertices[] = {
-0.5f, -0.5f, 0.5f, 1.0f, // p1
0.0f, uv_y_a, // uv1
-0.5f, 0.5f, 0.5f, 1.0f, // p2
0.0f, uv_y_b, // uv2
0.5f, 0.5f, 0.5f, 1.0f, // p3
1.0f, uv_y_b, // uv3
0.5f, -0.5f, 0.5f, 1.0f, // p4
1.0f, uv_y_a, // uv4
};
bcp.buffer_size = sizeof(textured_vertex) * 4;
bcp.data = (void*)&quad_vertices[0];
u32 quad_vertex_buffer = pen::renderer_create_buffer(bcp);
// create index buffer
u16 indices[] = {0, 1, 2, 2, 3, 0};
bcp.usage_flags = PEN_USAGE_DEFAULT;
bcp.bind_flags = PEN_BIND_INDEX_BUFFER;
bcp.cpu_access_flags = 0;
bcp.buffer_size = sizeof(u16) * 6;
bcp.data = (void*)&indices[0];
u32 quad_index_buffer = pen::renderer_create_buffer(bcp);
// create a sampler object so we can sample a texture
pen::sampler_creation_params scp;
pen::memory_zero(&scp, sizeof(pen::sampler_creation_params));
scp.filter = PEN_FILTER_MIN_MAG_MIP_LINEAR;
scp.address_u = PEN_TEXTURE_ADDRESS_CLAMP;
scp.address_v = PEN_TEXTURE_ADDRESS_CLAMP;
scp.address_w = PEN_TEXTURE_ADDRESS_CLAMP;
scp.comparison_func = PEN_COMPARISON_ALWAYS;
scp.min_lod = 0.0f;
scp.max_lod = 4.0f;
pen::depth_stencil_creation_params depth_stencil_params = {0};
depth_stencil_params.depth_enable = true;
depth_stencil_params.depth_write_mask = 1;
depth_stencil_params.depth_func = PEN_COMPARISON_ALWAYS;
u32 depth_stencil_state = pen::renderer_create_depth_stencil_state(depth_stencil_params);
u32 render_target_texture_sampler = pen::renderer_create_sampler(scp);
while (1)
{
// bind render target and draw basic triangle
pen::renderer_set_rasterizer_state(raster_state);
// bind and clear render target
pen::renderer_set_targets(colour_render_target, PEN_NULL_DEPTH_BUFFER);
pen::renderer_set_viewport(vp_rt);
pen::renderer_set_scissor_rect(rect{vp_rt.x, vp_rt.y, vp_rt.width, vp_rt.height});
pen::renderer_clear(clear_state_rt);
pen::renderer_set_depth_stencil_state(depth_stencil_state);
// draw tri into the render target
if (1)
{
// bind shader / input layout
pmfx::set_technique(basic_tri_shader, 0);
// bind vertex buffer
pen::renderer_set_vertex_buffer(triangle_vertex_buffer, 0, sizeof(vertex), 0);
// draw
pen::renderer_draw(3, 0, PEN_PT_TRIANGLELIST);
}
// bind back buffer and clear
pen::renderer_set_targets(PEN_BACK_BUFFER_COLOUR, PEN_BACK_BUFFER_DEPTH);
pen::renderer_set_viewport(vp);
pen::renderer_set_scissor_rect(rect{vp.x, vp.y, vp.width, vp.height});
pen::renderer_clear(clear_state);
// draw quad
{
// bind shader / input layout
pmfx::set_technique(textured_shader, 0);
// set vertex buffer
pen::renderer_set_vertex_buffer(quad_vertex_buffer, 0, sizeof(textured_vertex), 0);
pen::renderer_set_index_buffer(quad_index_buffer, PEN_FORMAT_R16_UINT, 0);
// bind render target as texture on sampler 0
pen::renderer_set_texture(colour_render_target, render_target_texture_sampler, 0, pen::TEXTURE_BIND_PS);
// draw
pen::renderer_draw_indexed(6, 0, 0, PEN_PT_TRIANGLELIST);
// unbind render target from the sampler
pen::renderer_set_texture(0, render_target_texture_sampler, 0, pen::TEXTURE_BIND_PS);
}
// present
pen::renderer_present();
// for unit test
pen::renderer_test_run();
pen::renderer_consume_cmd_buffer();
// msg from the engine we want to terminate
if (pen::semaphore_try_wait(p_thread_info->p_sem_exit))
{
break;
}
}
// clean up mem here
pen::renderer_release_depth_stencil_state(depth_stencil_state);
pen::renderer_release_raster_state(raster_state);
pen::renderer_release_buffer(triangle_vertex_buffer);
pen::renderer_release_buffer(quad_vertex_buffer);
pen::renderer_release_buffer(quad_index_buffer);
pen::renderer_release_render_target(colour_render_target);
pmfx::release_shader(basic_tri_shader);
pmfx::release_shader(textured_shader);
pen::renderer_consume_cmd_buffer();
// signal to the engine the thread has finished
pen::semaphore_post(p_thread_info->p_sem_terminated, 1);
return PEN_THREAD_OK;
}
| [
"alexandercdixon@gmail.com"
] | alexandercdixon@gmail.com |
2da8f7f85598e6a7eaa8bd22601a018a949644e9 | ea1374ec5a630d7bbc4fcef134233b900175e075 | /Framework/TriangleCollider.h | 0f7239fd76a25ebe9c7806c11ba3599385a8eed6 | [] | no_license | NightNMare/2019GameProject | de659385ac02027a7e8580f36d2d30a400d297f7 | b5aaf73e00c53d30a7e76ed69844f17a417f454c | refs/heads/master | 2020-09-13T06:28:50.663747 | 2019-11-25T13:52:37 | 2019-11-25T13:52:37 | 222,595,629 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 548 | h | #pragma once
#include "Collider.h"
class TriangleCollider :
public Collider
{
public:
TriangleCollider(Transform& transform, const Vector2& top, const Vector2& left, const Vector2& right);
public:
Triangle boundingTriangle;
public:
virtual bool Intersected(Collider& col);
virtual bool Intersected(const AABBBox& box);
virtual bool Intersected(const Circle& circle);
virtual bool Intersected(const Vector2& vector);
virtual bool Intersected(const Triangle& tri);
public:
Triangle GetTransformedTriangle();
virtual void Update() {}
};
| [
"dlarbdnjs1@naver.com"
] | dlarbdnjs1@naver.com |
1c1d7446f032c4d20b55841e16403cbe380c38b8 | 03d549fcb02760965f47095cf4414f4b55fef766 | /InfoFile.cpp | 65d65fc6893200c301182dbca8eab75d6d279e80 | [] | no_license | fhty/mfc-test | 50fdb46a78b093028b070f6ad60d8d4d36aed74d | 8813557a0428226c7d8f3839131f052333c4b691 | refs/heads/master | 2020-06-19T19:45:32.073404 | 2019-07-15T15:15:49 | 2019-07-15T15:15:49 | 196,847,468 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,522 | cpp | #include "stdafx.h"
#include "InfoFile.h"
#include <string.h>
InfoFile::InfoFile()
{
}
InfoFile::~InfoFile()
{
}
void InfoFile::readLogin(CString & name, CString & paw)
{
ifstream ifs;
ifs.open(_F_LOGIN);
char buf[512] = { 0 };
ifs.getline(buf, sizeof(buf));
name = CString(buf);//char*转CString。
ifs.getline(buf, sizeof(buf));
paw = CString(buf);
ifs.close();
}
void InfoFile::changePaw(char * name, char * paw)
{
ofstream ofs;//文件输出流对象。
ofs.open(_F_LOGIN);//打开文件。
ofs << name << endl;
ofs << paw << endl;
ofs.close();
}
void InfoFile::readDocline()
{
ifstream ifs;
ifs.open(_F_STOCK);
char buf[512] = { 0 };
_num = 0;
_ls.clear();
ifs.getline(buf, sizeof(buf));
while (!ifs.eof())
{
msg t;
ifs.getline(buf, sizeof(buf));
_num++;
char *s = strtok(buf, "|");
if (s == nullptr) break;
t.id = atoi(s);
s = strtok(NULL, "|");
t.name = s;
s = strtok(NULL, "|");
t.price = atoi(s);
s = strtok(NULL, "|");
t.num = atoi(s);
_ls.emplace_back(t);
}
ifs.close();
}
void InfoFile::writeDocline()
{
ofstream ofs(_F_STOCK);
if (_ls.size() != 0) {
ofs << "商品代号|商品名称|商品价格|库存" << endl;
for (auto it = _ls.begin(); it != _ls.end(); ++it) {
ofs << it->id << "|" << it->name << "|" << it->price << "|" << it->num << endl;
}
}
ofs.close();
}
void InfoFile::addLine(CString name, int num, int price)
{
msg add;
add.name = (char *)name.GetBuffer(0);
add.num += num;
add.price = price;
_ls.emplace_back(add);
}
| [
"1910351077@qq.com"
] | 1910351077@qq.com |
26e8bd0200a9764b0a51493128b21daffbdbf61f | 56854b3a7640123f6bd879cde5e36bbf2022b27f | /ch7/ch703/GraphicsItem/mainwindow.cpp | f3ff9819059241ea598f5caa13841af962e39acb | [] | no_license | Jamence/Qt5- | 4cb8edc7486292aaf7c9235bb59322bb135fe364 | f9dd6b74a18c10ad61c7c9024e19687c34808f1d | refs/heads/master | 2021-07-20T00:46:10.888674 | 2017-10-24T08:35:06 | 2017-10-24T08:35:06 | 106,234,029 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,825 | cpp | #include "mainwindow.h"
#include "flashitem.h"
#include "startitem.h"
#include <QGraphicsItemAnimation>
#include <QTimeLine>
#include <QDebug>
#include <QTime>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
createActions(); //创建主窗体的所有动作
createMenus(); //创建主窗体的菜单栏
scene = new QGraphicsScene;
scene->setSceneRect(-200,-200,400,400);
initScene(); //初始化场景
QGraphicsView *view = new QGraphicsView;
view->setScene(scene);
view->setMinimumSize(400,400);
view->show();
setCentralWidget(view);
resize(550,450);
// resize(1000,1000);
setWindowTitle(tr("Graphics Items"));
}
MainWindow::~MainWindow()
{
}
void MainWindow::createActions() //创建主窗体的所有动作
{
newAct = new QAction(tr("NEW"),this);
clearAct = new QAction(tr("CLEAR"),this);
exitAct = new QAction(tr("EXIT"),this);
addEllipseItem_TextAct = new QAction(tr("ENTER Ellipse AND TEXT"),this);
connect(newAct,SIGNAL(triggered()),this,SLOT(slotNew()));
connect(clearAct,SIGNAL(triggered()),this,SLOT(slotClear()));
connect(exitAct,SIGNAL(triggered()),this,SLOT(close()));
connect(addEllipseItem_TextAct,SIGNAL(triggered()),this,SLOT (slotAddEllipse_TextItem()));
}
void MainWindow::createMenus() //创建主窗体的菜单栏
{
QMenu *fileMenu = menuBar()->addMenu(tr("FILE"));
fileMenu->addAction(newAct);
fileMenu->addAction(clearAct);
fileMenu->addSeparator();
fileMenu->addAction(exitAct);
QMenu *itemsMenu = menuBar()->addMenu(tr("ELEMENT"));
itemsMenu->addAction(addEllipseItem_TextAct);
}
void MainWindow::initScene() //初始化场景
{
int i,n;
for(i=1;i<=6;i++){
slotAddEllipse_TextItem(i);
}
addLine(1,2);
addLine(1,3);
addLine(1,4);
addLine(1,5);
}
void MainWindow::slotNew() //新建一个显示窗体
{
slotClear();
initScene();
MainWindow *newWin = new MainWindow;
newWin->show();
}
void MainWindow::slotClear() //清除场景中所有的图元
{
QList<QGraphicsItem*> listItem = scene->items();
while(!listItem.empty())
{
scene->removeItem(listItem.at(0));
listItem.removeAt(0);
}
}
void MainWindow::slotAddEllipse_TextItem(int i) //在场景中加入一个椭圆形图元
{
QFont font("Times",16);
QString string_display=QString::number(i,10);
QGraphicsTextItem *itemText = new QGraphicsTextItem(string_display);
itemText->setFont(font);
itemText->setFlag(QGraphicsItem::ItemIsMovable);
itemText->setDefaultTextColor(QColor(256,256,256));
itemText->setPos(30,30);
QGraphicsEllipseItem *itemEllipse = new QGraphicsEllipseItem(QRectF(0,0,60, 60));
itemEllipse->setPen(Qt::NoPen);
itemEllipse->setBrush(QColor(qrand()%256,qrand()%256,qrand()%256));
itemEllipse->setFlag(QGraphicsItem::ItemIsMovable);
QGraphicsItemGroup *group=new QGraphicsItemGroup();
group->addToGroup(itemEllipse);
group->addToGroup(itemText);
group->setFlag(QGraphicsItem::ItemIsMovable);
scene->addItem(group);
int posx,posy;
posx=(qrand()%int(scene->sceneRect().width()))-200;
posy=(qrand()%int(scene->sceneRect().height()))-200;
group->setPos(posx,posy);
pos[i][0]=posx;
pos[i][1]=posy;
}
void MainWindow::addLine(int start,int end)
{
QGraphicsLineItem *line=new QGraphicsLineItem();
QPen *pen1=new QPen();
pen1->setColor(Qt::black);
line->setPen(*pen1);
line->setFlag(QGraphicsItem::ItemIsMovable);
line->setLine(pos[start][0]+30,pos[start][1]+30,pos[end][0]+30,pos[end][1]+30);
scene->addItem(line);
}
| [
"2232092982@qq.com"
] | 2232092982@qq.com |
1852c06b9f044b3e50e4305c337fe47b1929c750 | 52b3a98f041207fbbdb44e427aef681a7d5f85b9 | /private/src/lib_ptp_daemon/IasLibPtpDaemon.cpp | 8b89fd6515ad0aa0e8ec228bd3f6ad1ca2332d74 | [
"BSD-3-Clause"
] | permissive | keerockl/AVBStreamHandler | b783ad3fbfbfcf306762101266fe41d7ae71d51a | c0c9aa92656ae0acd0f57492d4f325eee2f7d13b | refs/heads/master | 2020-03-28T22:08:48.452817 | 2018-10-22T20:41:09 | 2018-10-22T20:41:09 | 149,208,065 | 1 | 0 | NOASSERTION | 2018-10-22T20:41:10 | 2018-09-18T01:01:20 | C++ | UTF-8 | C++ | false | false | 33,881 | cpp | /*
* Copyright (C) 2018 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file IasLibPtPDaemon.cpp
* @brief Library for the PTP daemon.
* @date 2013
*/
#include "lib_ptp_daemon/IasLibPtpDaemon.hpp"
#include "avb_streamhandler/IasAvbStreamHandlerEnvironment.hpp"
#include "avb_streamhandler/IasDiaLogger.hpp"
#include <unistd.h>
#include <sys/mman.h> // For shared memory mapping
#include <fcntl.h> // For O_* constants
#include <pthread.h> // For mutex
#include <cstring> // For memcpy
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <linux/ethtool.h>
#include <linux/if.h>
#include <linux/sockios.h>
#include <stdlib.h>
#include <signal.h>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <dlt_cpp_extension.hpp>
#ifdef __ANDROID__
#include <shm_posix.h>
#endif
namespace IasMediaTransportAvb {
static const std::string cClassName = "IasLibPtpDaemon::";
#define LOG_PREFIX cClassName + __func__ + "(" + std::to_string(__LINE__) + "):"
#define TSAUXC 0x0B640
#define TSAUXC_SAMP_AUTO 0x00000008
#define AUXSTMPH0 0x0B660
#define AUXSTMPL0 0x0B65C
/**
* Constructor.
*/
IasLibPtpDaemon::IasLibPtpDaemon(std::string const &sharedMemoryName, uint32_t const &sharedMemorySize)
: mInstanceName("IasLibPtpDaemon")
, mInitialized(false)
, mSharedMemoryFd(-1)
, mMemoryOffsetBuffer(NULL)
, mSharedMemoryName(sharedMemoryName)
, mSharedMemorySize(sharedMemorySize)
, mTscToLocalFactor(1.0)
, mRawToLocalFactor(1.0)
, mRawNormalFactorDeviation(0.005) // cNormalFactorDeviation
, mAvgCoeff(1.0)
, mRawAvgCoeff(1.0)
, mLastTime(0u)
, mLastLocalTimeforRaw(0u)
, mLastTsc(0u)
, mLastRaw(0u)
, mEpochCounter(0u)
, mClockHandle(-1)
, mClockId(-1)
, mAvgDelta(0.0f)
, mLastTimeMutex()
, mProcessId(0)
, mLog(&IasAvbStreamHandlerEnvironment::getDltContext("_PTP"))
, mIgbDevice(NULL)
, mLocalTimeUpdating(false)
, mMaxCrossTimestampSamples(cMaxCrossTimestampSamples)
, mSysTimeMeasurementThreshold(cSysTimeMeasurementThreshold)
, mRawXtstampEn(eRawXtstampImplDisable)
, mDiag()
, mTscEpoch(0u)
, mTscFreq(0u)
, mRawToLocalTstampThreshold(cRawTimeMeasurementThreshold)
, mRawToLocalFactors()
{
DLT_LOG_CXX(*mLog, DLT_LOG_VERBOSE, LOG_PREFIX);
}
IasLibPtpDaemon::Diag::Diag()
: rawXCount(0u)
, rawXFail(0u)
, rawXMaxInt(0u)
, rawXMinInt(0u)
, rawXTotalInt(0u)
{
}
/**
* Destructor.
*/
IasLibPtpDaemon::~IasLibPtpDaemon()
{
DLT_LOG_CXX(*mLog, DLT_LOG_VERBOSE, LOG_PREFIX);
cleanUp();
}
/**
* Initialization method.
*/
IasAvbProcessingResult IasLibPtpDaemon::init()
{
IasAvbProcessingResult result = eIasAvbProcOK;
// If already initialized skip this
if (mInitialized)
{
DLT_LOG_CXX(*mLog, DLT_LOG_WARN, LOG_PREFIX, "Already initialized!");
}
else
{
// open shared memory provided by PTP daemon
mSharedMemoryFd = shm_open(mSharedMemoryName.c_str(), O_RDWR, 0);
if (-1 == mSharedMemoryFd)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Couldn't open shared memory:", strerror(errno));
result = eIasAvbProcInitializationFailed;
}
// Map the shared memory device into virtual memory
if (eIasAvbProcOK == result)
{
mMemoryOffsetBuffer = static_cast<uint8_t*>(mmap(NULL, mSharedMemorySize, PROT_READ | PROT_WRITE, MAP_SHARED, mSharedMemoryFd, 0));
if (MAP_FAILED == mMemoryOffsetBuffer)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "mmap() failed!");
mMemoryOffsetBuffer = NULL;
shm_unlink(SHM_NAME);
result = eIasAvbProcInitializationFailed;
}
}
if (eIasAvbProcOK == result)
{
std::string path;
if (!IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cNwIfPtpDev, path))
{
getPtpDevice(path);
}
if (path.empty())
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Failed to get ptp device path!");
result = eIasAvbProcInitializationFailed;
}
else
{
mClockHandle = ::open( path.c_str(), O_RDONLY );
if (mClockHandle < 0)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Failed to open PTP clock device",
path.c_str(), ": Error=", errno, strerror(errno));
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Falling back to register-based access");
}
else
{
mClockId = ((~(clockid_t(mClockHandle)) << 3) | 3);
AVB_ASSERT(mClockId != -1);
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Using", path.c_str(), "to access ptp time / local time");
}
}
}
if (eIasAvbProcOK == result)
{
/*
* mIgbDevice might be NULL for some unit test cases. IasLibPtpDaemon will run
* in a fallback mode by using generic clock_gettime() instead of libigb API in
* those cases.
*/
mIgbDevice = IasAvbStreamHandlerEnvironment::getIgbDevice();
// initialize cross-timestamp parameters before getting initial cross-timestamp in calculateConversionCoeffs()
IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cPtpXtstampThresh, mSysTimeMeasurementThreshold);
IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cPtpXtstampLoopCount, mMaxCrossTimestampSamples);
IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cClkRawXTimestamp, mRawXtstampEn);
if (mRawXtstampEn)
{
if (eRawXtstampImplRev2 == mRawXtstampEn)
{
mRawToLocalTstampThreshold = 300u;
mRawNormalFactorDeviation = 0.094 * 1e-6;
}
IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cClkRawXtstampThresh, mRawToLocalTstampThreshold);
uint64_t val = 0;
if (IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cClkRawDeviationUnlock, val))
{
mRawNormalFactorDeviation = double(val) * 1e-7; // 0.1 ppm (e.g. clockdomain.raw.deviation.unlock=10 means 1 ppm)
}
val = 0;
if (IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cClkRawRatioToPtp, val))
{
mRawToLocalFactor = double(val) * 1e-7;
}
std::ostringstream strInitFactor;
strInitFactor << std::setprecision(7) << std::setiosflags(std::ios::fixed) << mRawToLocalFactor;
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "raw xtstamp:", (mRawXtstampEn) ? "on," : "off,", "rev:", mRawXtstampEn,
"clock unlock:", mRawNormalFactorDeviation * 1e6, "ppm,",
"initial ratio to ptp:", strInitFactor.str());
if (1.0 != mRawToLocalFactor)
{
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "raw rate ratio smoothing stabilized:", strInitFactor.str());
mRawAvgCoeff = 0.1;
}
if (IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cClkRawTscFreq, mTscFreq))
{
mTscFreq /= 1000; // convert to kHz
}
else
{
result = detectTscFreq();
}
if (0u != mTscFreq)
{
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "tsc frequency:", mTscFreq, "kHz");
}
else
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "unable to get tsc frequency");
result = eIasAvbProcErr; // if user-specified freq was 0
}
}
if (eIasAvbProcOK == result)
{
result = calculateConversionCoeffs();
}
}
// Check the result
if (eIasAvbProcOK == result)
{
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "PTP proxy successfully initialized!");
mInitialized = true;
}
else
{
cleanUp();
}
}
return result;
}
void IasLibPtpDaemon::getPtpDevice(std::string & path)
{
path.clear();
struct ethtool_ts_info info;
struct ifreq ifr;
const std::string* nwIfName = IasAvbStreamHandlerEnvironment::getNetworkInterfaceName();
int32_t sd;
// already opened or error querying network interface name
if (NULL == nwIfName)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "No network interface name specified!");
}
else
{
sd = socket(PF_UNIX, SOCK_DGRAM, 0);
if (sd < 0)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Error opening socket for ptp device selection:", errno, strerror(errno));
}
else
{
memset(&info, 0, sizeof info);
info.cmd = ETHTOOL_GET_TS_INFO;
memset(&ifr, 0, sizeof ifr);
strncpy(ifr.ifr_name, nwIfName->c_str(), (sizeof ifr.ifr_name) - 1u);
ifr.ifr_name[(sizeof ifr.ifr_name) - 1u] = '\0';
ifr.ifr_data = &info;
if (ioctl(sd, SIOCETHTOOL, &ifr) < -1)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Error querying ptp device for:",
nwIfName->c_str(), ": Error=", errno, strerror(errno));
}
else
{
char buf[16];
snprintf(buf, sizeof buf, "%d", info.phc_index);
buf[(sizeof buf) - 1u] = '\0';
path = "/dev/ptp";
path += buf;
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Device path set to", path.c_str());
}
close(sd);
}
}
}
IasAvbProcessingResult IasLibPtpDaemon::calculateConversionCoeffs()
{
IasAvbProcessingResult ret = eIasAvbProcOK;
if (-1 == mClockId)
{
ret = eIasAvbProcInitializationFailed;
}
else
{
// just init the "last time" members and set the initial conversion rate to 1.0
mLastTsc = getTsc();
mLastRaw = getRaw();
struct timespec tp;
if (clock_gettime(mClockId, &tp) < 0)
{
ret = eIasAvbProcInitializationFailed;
}
else
{
mLastTime = convertTimespecToNs(tp);
mLastLocalTimeforRaw = mLastTime;
mTscToLocalFactor = 1.0;
mRawToLocalFactor = 1.0;
mAvgCoeff = 1.0;
mRawAvgCoeff = 1.0;
if (mRawXtstampEn) // raw specific code
{
const uint64_t cRawInitXtstampMaxTrial = (eRawXtstampImplRev2 == mRawXtstampEn) ? (std::numeric_limits<uint64_t>::max()) : (10);
for (uint64_t i = 0; i < cRawInitXtstampMaxTrial; i++)
{
if (getIgbTime(mLastLocalTimeforRaw, mLastRaw, cRawClockId) == eIasAvbProcOK)
{
break;
}
if ((i + 1) == cRawInitXtstampMaxTrial)
{
DLT_LOG_CXX(*mLog, DLT_LOG_WARN, LOG_PREFIX, "raw-x-tstamp: initial precision cross-timestaming failed.",
"timestamp jitters may happen at the beginning of tx streams.");
// fall-back for only at init phase
uint64_t raw1 = 0u;
uint64_t raw2 = 0u;
struct timespec tp;
raw1 = getRaw();
clock_gettime(mClockId, &tp);
raw2 = getRaw();
mLastRaw = (raw1 >> 1) + (raw2 >> 1);
mLastLocalTimeforRaw = convertTimespecToNs(tp);
}
}
mRawToLocalFactors.clear();
}
}
}
return ret;
}
void IasLibPtpDaemon::cleanUp()
{
// Unmap shm device
if (NULL != mMemoryOffsetBuffer)
{
munmap(mMemoryOffsetBuffer, mSharedMemorySize);
mMemoryOffsetBuffer = NULL;
}
// Close shared memory
if (-1 != mSharedMemoryFd)
{
close(mSharedMemoryFd);
mSharedMemoryFd = -1;
}
if (-1 != mClockHandle)
{
mClockId = -1;
close(mClockHandle);
mClockHandle = -1;
}
mProcessId = 0;
mInitialized = false;
}
uint64_t IasLibPtpDaemon::rawToPtp(const uint64_t sysTime) const
{
(void) mLastTimeMutex.lock();
const uint64_t offset1 = mLastRaw;
const double factor = mRawToLocalFactor;
const uint64_t offset2 = mLastLocalTimeforRaw;
(void) mLastTimeMutex.unlock();
if (!mRawXtstampEn)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "cross timestamps for RawClockDomain is disabled. "
"check if the 'clockdomain.raw.xtstamp' key is set.");
}
DLT_LOG_CXX(*mLog, DLT_LOG_VERBOSE, LOG_PREFIX, "lastRaw", offset1,
"factor", factor,
"lastTime", offset2);
return uint64_t(int64_t(double(int64_t(sysTime - offset1)) * factor)) + offset2;
}
uint64_t IasLibPtpDaemon::sysToPtp(const uint64_t sysTime) const
{
(void) mLastTimeMutex.lock();
const uint64_t offset1 = mLastTsc;
const double factor = mTscToLocalFactor;
const uint64_t offset2 = mLastTime;
(void) mLastTimeMutex.unlock();
DLT_LOG_CXX(*mLog, DLT_LOG_VERBOSE, LOG_PREFIX, "lastTsc", offset1,
"factor", factor,
"lastTime", offset2);
return uint64_t(int64_t(double(int64_t(sysTime - offset1)) * factor)) + offset2;
}
uint64_t IasLibPtpDaemon::ptpToSys(const uint64_t ptpTime) const
{
(void) mLastTimeMutex.lock();
const uint64_t offset1 = mLastTime;
const double factor = bool(mTscToLocalFactor) ? 1 / mTscToLocalFactor : 0.0;
const uint64_t offset2 = mLastTsc;
(void) mLastTimeMutex.unlock();
DLT_LOG_CXX(*mLog, DLT_LOG_VERBOSE, LOG_PREFIX, "lastTime", offset1,
"factor", factor,
"lastTsc", offset2);
return uint64_t(int64_t(double(int64_t(ptpTime - offset1)) * factor)) + offset2;
}
uint64_t IasLibPtpDaemon::getLocalTime()
{
(void) mLastTimeMutex.lock();
const uint64_t offset1 = mLastTsc;
const double factor = mTscToLocalFactor;
const uint64_t offset2 = mLastTime;
bool doUpdate = false;
uint64_t ret = uint64_t(int64_t(double(int64_t(getTsc() - offset1)) * factor));
if ((ret > cUpdateThreshold) && !mLocalTimeUpdating)
{
/*
* prevent concurrent calls to getRealLocalTime()
*
* The getRealLocalTime() will lock the IGB device to read the I210 clock from its registers.
* This lock would block threads using the libigb API such as the TX sequencer.
* Prevent calling getRealLocalTime() if the updating is already in progress on other thread
* so that we can avoid unnecessary blocking.
*/
doUpdate = true;
mLocalTimeUpdating = true;
}
(void) mLastTimeMutex.unlock();
DLT_LOG_CXX(*mLog, DLT_LOG_VERBOSE, LOG_PREFIX, "lastTsc", offset1,
"factor", factor,
"lastTime", offset2);
if (doUpdate)
{
ret = getRealLocalTime();
(void) mLastTimeMutex.lock();
mLocalTimeUpdating = false;
(void) mLastTimeMutex.unlock();
}
else
{
ret += offset2;
}
return ret;
}
bool IasLibPtpDaemon::isPtpReady()
{
bool ptpReadyState = false;
uint8_t* pData;
gPtpTimeData* pPtpTimeData;
uint32_t syncCount = 0;
uint32_t pdelayCount = 0;
(void) IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cPtpPdelayCount, pdelayCount);
(void) IasAvbStreamHandlerEnvironment::getConfigValue(IasRegKeys::cPtpSyncCount, syncCount);
if (NULL != mMemoryOffsetBuffer)
{
pData = mMemoryOffsetBuffer + sizeof(pthread_mutex_t);
pPtpTimeData = reinterpret_cast<gPtpTimeData*>(pData);
mProcessId = pPtpTimeData->process_id; // save the process id of PTP daemon to be able to send a signal to it
if ((pPtpTimeData->port_state == PTP_MASTER) && (pPtpTimeData->pdelay_count >= pdelayCount))
{
// @@DIAG for master devices, this indicates we've reached "AVB sync state" - BUT NEEDS CONFIRMATION
ptpReadyState = true;
}
else if ((pPtpTimeData->port_state == PTP_SLAVE) && (pPtpTimeData->sync_count >= syncCount))
{
// @@DIAG for slave devices, this indicates we've reached "AVB sync state"
ptpReadyState = true;
}
else
{
ptpReadyState = false;
}
}
if (ptpReadyState)
{
IasDiaLogger* diaLogger = IasAvbStreamHandlerEnvironment::getDiaLogger();
const int32_t* socket = IasAvbStreamHandlerEnvironment::getStatusSocket();
if ((NULL != diaLogger) && (NULL != socket))
{
diaLogger->triggerAvbSyncPacket(*socket);
}
}
return ptpReadyState;
}
IasAvbProcessingResult IasLibPtpDaemon::triggerStorePersistenceData() const
{
IasAvbProcessingResult ret = eIasAvbProcOK;
if (0 != mProcessId)
{
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Sending 'hangup' signal to PID =", mProcessId);
if (-1 == kill(mProcessId, SIGHUP)) // send signal 'Hangup' (-1) to PTP daemon
{
DLT_LOG_CXX(*mLog, DLT_LOG_WARN, LOG_PREFIX, "System call 'kill' failed error=", errno);
}
}
else
{
ret = eIasAvbProcErr;
DLT_LOG_CXX(*mLog, DLT_LOG_WARN, LOG_PREFIX, "Process ID for PTP daemon is not set!");
}
return ret;
}
uint64_t IasLibPtpDaemon::getRealLocalTime(const bool force)
{
uint64_t ret;
uint64_t lt = 0u;
uint64_t tsc1 = 0u;
uint64_t tsc2 = 0u;
uint64_t raw1 = 0u;
uint64_t raw2 = 0u;
uint64_t localTimeForRaw = 0u;
uint32_t attempt;
// lower bound for smoothing filter coefficient
static const double cSmoothBound = 0.1;
// multiplicative step for changing the filter coefficient
static const double cSmoothStep = 0.99;
// acceptable factor deviation
static const double cNormalFactorDeviation = 0.005;
(void) mLastTimeMutex.lock();
for (ret = mLastTime, attempt = 1u; ret == mLastTime; attempt++)
{
if (mClockId != -1)
{
if (eIasAvbProcOK != getIgbTime(lt, tsc1, cSysClockId))
{
// get ptp time with clock_gettime() as a fallback
struct timespec tp;
tsc1 = getTsc();
int32_t r = clock_gettime(mClockId, &tp);
tsc2 = getTsc();
// calculate arithmetic mean of kernel time before and after reading I210 clock to reduce error
tsc1 = (tsc1 >> 1) + (tsc2 >> 1);
if (r < 0)
{
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Failed to get time from PTP clock",
mClockId, ": Error=", errno, strerror(errno));
}
else
{
lt = convertTimespecToNs(tp);
}
}
else
{
// success
}
}
else
{
ret = 0u;
}
if (0u != mLastTime)
{
int64_t delta = int64_t(lt - mLastTime);
int64_t deltaTsc = tsc1 - mLastTsc;
if (delta < 0)
{
/**
* @log Negative local time change
*/
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "#", attempt,
"negative local time change!", delta, 1e9f/mAvgDelta,
"avg read access/sec) last:", mLastTime, "now:",
lt);
attempt++;
}
else
{
const int64_t phaseError = delta - int64_t(double(deltaTsc) * mTscToLocalFactor);
// ignore phase error until smoothing has stabilized except if phase error is too high
if (((mAvgCoeff <= cSmoothBound) && (llabs(phaseError) > cEpochChangeThreshold)) ||
(llabs(phaseError) > (cEpochChangeThreshold * 10)))
{
mEpochCounter++;
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "#", attempt,
"detected epoch change, phase error =", phaseError,
"new epoch =", mEpochCounter, 1e9f/mAvgDelta,
"avg read access/sec) last:", mLastTime, "now:", lt);
mLastTime = 0u;
ret = lt;
}
else
{
// success
mAvgDelta = mAvgDelta * 0.9f + float(delta) * 0.1f;
ret = lt;
}
}
}
else
{
ret = lt;
}
if ((ret == mLastTime) && (attempt >= 3u))
{
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Unable to read reliable local time after",
attempt-1u, "attempts (", 1e9f / mAvgDelta, "avg read access/sec)");
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "assuming ptp epoch change");
mEpochCounter++;
mLastTime = 0u;
ret = 0u;
}
} // for
// if mLastTime is not valid, (re)initialize conversion coeffs to 1.0 and "last time" members
if (0u == mLastTime)
{
mLastTime = ret;
mLastTsc = tsc1;
mAvgCoeff = 1.0;
mTscToLocalFactor = 1.0;
if (mRawXtstampEn)
{
// raw specific code
if (eIasAvbProcOK != getIgbTime(localTimeForRaw, raw1, cRawClockId))
{
// fall-back for only init phase
struct timespec tp;
raw1 = getRaw();
clock_gettime(mClockId, &tp);
raw2 = getRaw();
raw1 = (raw1 >> 1) + (raw2 >> 1);
localTimeForRaw = convertTimespecToNs(tp);
}
mLastLocalTimeforRaw = localTimeForRaw;
mLastRaw = raw1;
mRawAvgCoeff = 1.0;
mRawToLocalFactor = 1.0;
mRawToLocalFactors.clear();
}
}
// otherwise update conversion coefficients only if enough time exceeded
else if ((force) || ((lt - mLastTime) > cUpdateThreshold))
{
double newFactor = double(int64_t(lt - mLastTime)) / double(int64_t(tsc1 - mLastTsc));
double factorDelta = (newFactor > mTscToLocalFactor) ?
(newFactor - mTscToLocalFactor) : (mTscToLocalFactor - newFactor);
static const double tolerance = 0.5;
if ((newFactor >= 1.0/(1.0 + tolerance)) && (newFactor <= (1.0 + tolerance)))
{
// use variable smoothing to stabilize value
mTscToLocalFactor = mAvgCoeff * newFactor + (1.0 - mAvgCoeff) * mTscToLocalFactor;
if (mAvgCoeff > cSmoothBound)
{
mAvgCoeff *= cSmoothStep;
}
DLT_LOG_CXX(*mLog, (factorDelta > cNormalFactorDeviation) ? DLT_LOG_WARN : DLT_LOG_DEBUG, LOG_PREFIX,
"coeff update: ",
"lt", lt,
"tsc", tsc1,
"dt", int64_t(lt - mLastTime),
"dtsc", int64_t(tsc1 - mLastTsc),
"newFactor", newFactor,
"avg", mTscToLocalFactor,
"ac", mAvgCoeff
);
}
else
{
DLT_LOG_CXX(*mLog, DLT_LOG_WARN, LOG_PREFIX, "time update: new factor out of range:", newFactor);
}
mLastTime = ret;
mLastTsc = tsc1;
if (mRawXtstampEn)
{
// raw specific code
if (eIasAvbProcOK != getIgbTime(localTimeForRaw, raw1, cRawClockId))
{
// unable to get precision cross time-stamps, free wheel with current factors
}
else
{
double newRawFactor = double(int64_t(localTimeForRaw - mLastLocalTimeforRaw)) / double(int64_t(raw1 - mLastRaw));
double factorRawDelta = (newRawFactor > mRawToLocalFactor) ? (newRawFactor - mRawToLocalFactor)
: (mRawToLocalFactor - newRawFactor);
DltLogLevelType loglevel = (factorRawDelta > mRawNormalFactorDeviation) ? DLT_LOG_WARN : DLT_LOG_DEBUG;
std::ostringstream strNewRawFactor;
std::ostringstream strAvbRawFactor;
strNewRawFactor << std::setprecision(7) << std::setiosflags(std::ios::fixed) << newRawFactor;
bool doUpdate = true;
bool hardRawDeviationCheckEn = (mRawNormalFactorDeviation != cNormalFactorDeviation) ? true : false;
static const uint64_t cRawClockUnlockCountMax = (eRawXtstampImplRev2 == mRawXtstampEn) ? (uint64_t(1e9) / cUpdateThreshold) * 10
: (uint64_t(1e9) / cUpdateThreshold) * 5; // 1s/125ms = 8 cycles * 5
if (hardRawDeviationCheckEn)
{
if (mRawAvgCoeff <= cSmoothBound)
{
// rate ratio value should not drastically change once smoothing has stabilized enough
if (mRawNormalFactorDeviation < fabs(factorRawDelta))
{
// rate ratio delta exceeded the threshold, it's likely caused by the precision constraint of cross-timestamps
if (++mDiag.rawXUnlockCount < cRawClockUnlockCountMax)
{
// skip rate ratio update since the derived value is not reliable
doUpdate = false;
}
else
{
// but accept the new ratio for fail-safe if the deviation lasted longer than 5 seconds
mDiag.rawXUnlockCount = 0;
if (eRawXtstampImplRev2 == mRawXtstampEn)
{
strAvbRawFactor << std::setprecision(7) << std::setiosflags(std::ios::fixed) << mRawToLocalFactor;
DLT_LOG_CXX(*mLog, DLT_LOG_WARN, LOG_PREFIX, "reset factor:",
"newFactor", strNewRawFactor.str(), "avg", strAvbRawFactor.str());
mRawAvgCoeff = 1.0;
mRawToLocalFactor = 1.0;
mRawToLocalFactors.clear();
}
}
}
}
else
{
// lower dlt log level while smoothing has not stabilized yet since rate ratio would change over the threshold
loglevel = DLT_LOG_DEBUG;
}
}
if ((doUpdate) && (newRawFactor >= 1.0/(1.0 + tolerance)) && (newRawFactor <= (1.0 + tolerance)))
{
mRawToLocalFactor = mRawAvgCoeff * newRawFactor + (1.0 - mRawAvgCoeff) * mRawToLocalFactor;
if ((mRawAvgCoeff > cSmoothBound) && (eRawXtstampImplRev2 == mRawXtstampEn))
{
if (uint32_t(mRawToLocalFactors.size()) < cRawInitFactorSampleCount)
{
mRawToLocalFactors.push_back(newRawFactor);
const uint32_t numFactors = uint32_t(mRawToLocalFactors.size());
if (numFactors == cRawInitFactorSampleCount)
{
/*
* collect cRawInitFactorSampleCount of factors and use the median as the initial reliable factor value
* afterwards restrict the bound of variable in order to stabilize outgoing AAF/CRF timestamp intervals.
*/
std::sort(mRawToLocalFactors.begin(), mRawToLocalFactors.end());
mRawToLocalFactor = (mRawToLocalFactors[numFactors/2 - 1] + mRawToLocalFactors[numFactors/2]) / 2.0;
mRawAvgCoeff = cSmoothBound;
strAvbRawFactor.clear();
strAvbRawFactor << std::setprecision(7) << std::setiosflags(std::ios::fixed) << mRawToLocalFactor;
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "raw rate ratio smoothing stabilized:", strAvbRawFactor.str());
}
}
}
strAvbRawFactor.clear();
strAvbRawFactor << std::setprecision(7) << std::setiosflags(std::ios::fixed) << mRawToLocalFactor;
if (mRawAvgCoeff > cSmoothBound)
{
mRawAvgCoeff *= cSmoothStep;
if ((hardRawDeviationCheckEn) && (mRawAvgCoeff <= cSmoothBound))
{
DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "raw rate ratio smoothing stabilized:", strAvbRawFactor.str());
}
}
DLT_LOG_CXX(*mLog, loglevel, LOG_PREFIX,
"coeff update raw: ",
"lt", localTimeForRaw,
"raw", raw1,
"dt", int64_t(localTimeForRaw - mLastLocalTimeforRaw),
"draw", int64_t(raw1 - mLastRaw),
"newFactor", strNewRawFactor.str(),
"avg", strAvbRawFactor.str(),
"ac", mRawAvgCoeff
);
if (hardRawDeviationCheckEn)
{
mLastLocalTimeforRaw = localTimeForRaw;
mLastRaw = raw1;
mDiag.rawXUnlockCount = 0;
}
}
else
{
loglevel = DLT_LOG_INFO;
if (hardRawDeviationCheckEn)
{
/*
* suppress the duplicated info message because if deviation could not be resolved
* until the next update timing, we can know it with the "coeff update raw:" message.
*/
loglevel = DLT_LOG_DEBUG;
}
DLT_LOG_CXX(*mLog, loglevel, LOG_PREFIX, "raw time update: new factor out of range:", strNewRawFactor.str());
}
if (!hardRawDeviationCheckEn)
{
/*
* Basically we should not update time values here if the calculated rate ratio is not reliable.
* But to keep the default behavior without setting the '-k clockdomain.raw.deviation.unlock'
* same as the former code as much as possible, we update time values here by default to avoid
* causing regressions to a certain customer who has started evaluation with the former code.
*/
mLastLocalTimeforRaw = localTimeForRaw;
mLastRaw = raw1;
}
}
}
}
else
{
// do nothing, wait until cUpdateThreashold is reached
}
(void) mLastTimeMutex.unlock();
return ret;
}
IasAvbProcessingResult IasLibPtpDaemon::getIgbTime(uint64_t &ptpTime, uint64_t &sysTime, const clockid_t clockId)
{
IasAvbProcessingResult result = eIasAvbProcOK;
uint64_t sysTimeMeasurementInterval = 0u;
uint64_t sysTimeMeasurementIntervalMin = std::numeric_limits<uint64_t>::max();
const uint64_t cXtstampThreshold = (cSysClockId == clockId) ? mSysTimeMeasurementThreshold : mRawToLocalTstampThreshold;
ptpTime = 0u;
sysTime = 0u;
for (uint64_t i = 0u; i < mMaxCrossTimestampSamples; i++)
{
/*
* The value of cMaxCrossTimestampSamples is 3 by default.
*
* This method gets the ptp/monotonic cross-timestamp maximum 3 times then returns the most accurate one.
* More iteration could provide higher accuracy. But since it has to lock the IGB device to access the registers
* and the lock might block the TX sequencer which calls igb_xmit(), the number of iteration should be limited.
*
* It took one third cpu time to read the I210 clock from the registers compared to the general approach
* using the clock_gettime(). Then we may do the iteration at least 3 times to get better accuracy without
* increasing cpu load. (approx time needed on MRB: direct register access 3 us, clock_gettime 10 us)
*/
if ((NULL == mIgbDevice) || (0 != igb_lock(mIgbDevice)) ||
((cSysClockId != clockId) && (cRawClockId != clockId)) )
{
result = eIasAvbProcErr;
break;
}
else
{
uint64_t sys1 = 0u;
uint64_t sys2 = 0u;
uint32_t tsauxcReg = 0u;
uint32_t stmph0Reg = 0u;
uint32_t stmpl0Reg = 0u;
(void) igb_readreg(mIgbDevice, TSAUXC, &tsauxcReg);
tsauxcReg |= TSAUXC_SAMP_AUTO;
// clear the value stored in AUXSTMPH/L0
(void) igb_readreg(mIgbDevice, AUXSTMPH0, &stmph0Reg);
sys1 = (cSysClockId == clockId) ? getTsc() : getRaw();
// set the SAMP_AUT0 flag to latch the SYSTIML/H registers
(void) igb_writereg(mIgbDevice, TSAUXC, tsauxcReg);
// memory fence to avoid reading the registers before writing the SAMP_AUT0 flag
__asm__ __volatile__("mfence;"
:
:
: "memory");
sys2 = (cSysClockId == clockId) ? getTsc() : getRaw();
// read the stored values
(void) igb_readreg(mIgbDevice, AUXSTMPH0, &stmph0Reg);
(void) igb_readreg(mIgbDevice, AUXSTMPL0, &stmpl0Reg);
(void) igb_unlock(mIgbDevice);
sysTimeMeasurementInterval = sys2 - sys1;
if (sysTimeMeasurementInterval < sysTimeMeasurementIntervalMin)
{
sysTime = (sys1 >> 1) + (sys2 >> 1);
ptpTime = stmph0Reg * uint64_t(1000000000u) + stmpl0Reg;
sysTimeMeasurementIntervalMin = sysTimeMeasurementInterval;
if (sysTimeMeasurementIntervalMin <= cXtstampThreshold)
{
// immediately exit the loop once we get cross-timestamp with the target accuracy
break;
}
}
}
}
if (cRawClockId == clockId)
{
mDiag.rawXCount++;
if (cXtstampThreshold < sysTimeMeasurementIntervalMin)
{
mDiag.rawXFail++;
result = eIasAvbProcErr;
}
// statistics for analysis
if (mDiag.rawXMaxInt < sysTimeMeasurementInterval)
{
mDiag.rawXMaxInt = sysTimeMeasurementInterval;
}
if ((0u == mDiag.rawXMinInt) || (sysTimeMeasurementInterval < mDiag.rawXMinInt))
{
mDiag.rawXMinInt = sysTimeMeasurementInterval;
}
mDiag.rawXTotalInt += sysTimeMeasurementInterval;
const double rawXSuccessRate = double(mDiag.rawXCount - mDiag.rawXFail)/double(mDiag.rawXCount);
const double rawXAvgInterval = double(mDiag.rawXTotalInt) / double(mDiag.rawXCount);
DLT_LOG_CXX(*mLog, DLT_LOG_DEBUG, LOG_PREFIX, "raw-x-tstamp diag: success rate avg =",
rawXSuccessRate, "interval avg =", rawXAvgInterval, "max =", mDiag.rawXMaxInt, "min =", mDiag.rawXMinInt);
}
return result;
}
IasAvbProcessingResult IasLibPtpDaemon::detectTscFreq(void)
{
IasAvbProcessingResult result = eIasAvbProcErr;
uint32_t eax = 0u;
uint32_t ebx = 0u;
uint32_t ecx = 0u;
uint32_t edx = 0u;
uint32_t family = 0u;
uint32_t model = 0u;
uint32_t crystalFreq = 0u;
const uint8_t cCpuModelAtomGoldmont = 0x5C; // Apollo Lake
// EAX=1H CPU model
asm volatile
("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
: "0" (1), "2" (0));
family = (eax >> 8) & 0xF;
model = eax >> 4 & 0xF;
if((0x6 == family) || (0xF == family))
{
model |= ((eax >> 16) & 0xF) << 4;
}
switch(model)
{
case cCpuModelAtomGoldmont:
crystalFreq = 19200000; // 19.2 MHz
break;
default:
DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "raw-x-tstamp: unsupported CPU model number", model);
break;
}
if ((0u != crystalFreq) && (0x15 <= eax)) // cpuid level
{
// EAX=15H TSC/ART ratio
asm volatile
("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
: "0" (0x15), "2" (0));
if (0u != eax)
{
// TSC_Value = (ART_Value * CPUID.15H:EBX[31:0])/CPUID.15H:EAX[31:0] + K; (K is ignored here)
mTscFreq = ((uint64_t)crystalFreq * ebx) / eax;
mTscFreq /= 1000; // convert to kHz
if (0u != mTscFreq)
{
result = eIasAvbProcOK;
}
}
}
return result;
}
} // namespace IasMediaTransportAvb
| [
"keerock.lee@intel.com"
] | keerock.lee@intel.com |
f1eb86263c915e87d4ccc8e98d2fcfc5339cf3f7 | e833ad6046ad849fb99255a41fe49208cf00a844 | /worksheets/ws17.cpp | 165c466d45afbeda2dfd7c1665fa70f831dbf172 | [] | no_license | jeffreynino/playground | 51845142e08bfff77768e90b65739b5b53ed0e22 | f7e752a1ba52216c9d10131cd285b189a829acd6 | refs/heads/main | 2023-03-13T22:21:03.683526 | 2021-03-03T03:54:56 | 2021-03-03T03:54:56 | 343,980,500 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 550 | cpp | // Jeffrey Nino, 5005572268, CS135 Section 1004, Worksheet 13
// Description: takes average of infile
// Input: infile
// Output: average of infile
#include <iostream>
#include <fstream>
using namespace std;
int main(){
double x[100];
double sum;
ifstream inFile;
inFile.open("wksheet17.txt");
inFile.is_open();
if(inFile.is_open()==false){
cout << "Error - input file not detected" << endl;
exit(0);
}
for (int i=0; i<100; i++){
inFile >> x[i];
sum +=x[i];
}
double average = sum/100;
cout << "Average is " << average << endl;
}
| [
"noreply@github.com"
] | noreply@github.com |
d63bd7ba3ed49eeaf2e45ea937334ff5f0ec87c9 | 7fc4184b6486ce8e3b6d05f0c95a0256812a99cd | /Prototypes/VULKAN/Triangle/CameraProgram.h | dbee0cf171f1184584ae6dc2a9566e9c68ded699 | [] | no_license | DerickThePoney/SFML-OPENGL-SUPERBIBLE | 03b539cb0e1799d52cb06727e3de0585f651011b | d3d4b46d89331cf2f9b8825512361dc57a3fc85c | refs/heads/master | 2021-07-03T17:46:34.063863 | 2019-03-23T14:31:08 | 2019-03-23T14:31:08 | 111,515,988 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,123 | h | #pragma once
class CameraProgram
{
public:
CameraProgram();
~CameraProgram();
void Set
(
glm::vec3 startP, glm::vec3 endP, float speedP,
glm::vec3 startR, glm::vec3 endR, float speedR
);
bool Update(float dt, glm::vec3& camPos, glm::vec3& camDir);
bool IsSet() { return bIsSet; }
private:
glm::vec3 startP = glm::vec3(-30.0f, 3.0f, 3.0f);
glm::vec3 endP = glm::vec3(15.0f, 8.0f, 1.0f);
float speedP = 0.005f;
glm::vec3 startR = glm::vec3(20.0f, 0.0f, -90.0f);
glm::vec3 endR = glm::vec3(-20.0f, 0.0f, 75.0f);
float speedR = 0.0185f;
float elapsed = 0.0f;
float expectedDurationP = glm::length(endP - startP) / speedP;
float expectedDurationR = glm::length(endR - startR) / speedR;
bool bIsSet;
};
class ObjectPositionAnimation
{
public:
ObjectPositionAnimation();
~ObjectPositionAnimation();
void SetTicksPerSecond(float ticks);
void AddKeyframe(float time, glm::mat4 TRS);
void Reset();
glm::mat4 Update(float dt);
private:
struct Keyframe
{
glm::mat4 TRS;
float time;
};
std::vector<Keyframe> keyframes;
float currentTime;
float ticksPerSeconds;
int currentKeyframe;
};
| [
"penetcedric@gmail.com"
] | penetcedric@gmail.com |
366419a4174bae37693f50e9746bbb7499307185 | 10d82ee86e6187a4d7f132401d711714c53f8828 | /src/scripts/src/GossipScripts/Gossip_Moonglade.cpp | 5b9bb83991a727b45127a5b73725db26fc53a7d8 | [] | no_license | al3xc1985/HearthStone-Emu | 315ffcebe6dbc396874c17378a68c26ac980cb47 | 8880fdda56f1ef1a0ae7b0efb9ac22b891334654 | refs/heads/master | 2021-03-21T19:57:10.950613 | 2011-10-24T13:52:23 | 2011-10-24T13:52:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,743 | cpp | /*
* Moon++ Scripts for Ascent MMORPG Server
* Copyright (C) 2007-2008 Moon++ Team <http://www.moonplusplus.info/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "StdAfx.h"
#include "Setup.h"
// Trenton Lighthammer
#define GOSSIP_SILVA_FILNAVETH "I'd like to fly to Rut'theran Village."
class SilvaFilnaveth_Gossip : public GossipScript
{
public:
void GossipHello(ObjectPointer pObject, PlayerPointer plr, bool AutoSend)
{
GossipMenu *Menu;
if(plr->getClass() == DRUID && plr->getRace() == RACE_NIGHTELF){
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4914, plr);
Menu->AddItem( 0, GOSSIP_SILVA_FILNAVETH, 1);
}else if(plr->getClass() == DRUID && plr->getRace() == RACE_TAUREN){
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4915, plr);
}else{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4913, plr);
};
if(AutoSend)
Menu->SendTo(plr);
}
void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code)
{
CreaturePointer pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULLCREATURE;
if(pCreature==NULLCREATURE)
return;
switch(IntId)
{
case 1:
{
TaxiPath * path = sTaxiMgr.GetTaxiPath( 315 ); // Flight Path
plr->TaxiStart( path, 479, 0 ); // Hippogryph
}break;
}
}
void Destroy()
{
delete this;
}
};
// Bunthen Plainswind
#define GOSSIP_BUNTHEN_PLAINSWIND "I'd like to fly to Thunder Bluff."
class BunthenPlainswind_Gossip : public GossipScript
{
public:
void GossipHello(ObjectPointer pObject, PlayerPointer plr, bool AutoSend)
{
GossipMenu *Menu;
if(plr->getClass() == DRUID && plr->getRace() == RACE_TAUREN){
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4918, plr);
Menu->AddItem( 0, GOSSIP_BUNTHEN_PLAINSWIND, 1);
}else if(plr->getClass() == DRUID && plr->getRace() == RACE_NIGHTELF){
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4917, plr);
}else{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4916, plr);
};
if(AutoSend)
Menu->SendTo(plr);
}
void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code)
{
CreaturePointer pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?(TO_CREATURE(pObject)):NULLCREATURE;
if(pCreature==NULLCREATURE)
return;
switch(IntId)
{
case 1:
{
TaxiPath * path = sTaxiMgr.GetTaxiPath( 316 ); // Flight Path
plr->TaxiStart( path, 295, 0 ); // Wyvern
}break;
}
}
void Destroy()
{
delete this;
}
};
void SetupMoongladeGossip(ScriptMgr * mgr)
{
GossipScript * SilvaFilnavethGossip = (GossipScript*) new SilvaFilnaveth_Gossip;
GossipScript * BunthenPlainswindGossip = (GossipScript*) new BunthenPlainswind_Gossip;
mgr->register_gossip_script(11800, SilvaFilnavethGossip); // Silva Fil'naveth
mgr->register_gossip_script(11798, BunthenPlainswindGossip); // Bunthen Plainswind
}
| [
"goodnightgm@gmail.com"
] | goodnightgm@gmail.com |
e69adfa400cd07a4b642497486c560d862e06068 | 1130bcd2ab620dcc7c5ea81e6d275283fdfb9f88 | /motorconditiontable.h | 40e6444ae42a8406694ac30b27d3bffd6b48ad9e | [] | no_license | 372272083/mfds | c2245f98ee4d5e5ec89379e72e61826f00d3d334 | 659f01e9e206ff12c2aa327968d24ef717d2b65d | refs/heads/master | 2020-04-14T15:03:51.850005 | 2019-08-12T08:54:54 | 2019-08-12T08:54:54 | 143,227,303 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 218 | h | #ifndef MOTORCONDITIONTABLE_H
#define MOTORCONDITIONTABLE_H
class MotorConditionTable
{
public:
MotorConditionTable();
float u;
float i;
float rotate;
int id;
};
#endif // MOTORCONDITIONTABLE_H
| [
"372272083@qq.com"
] | 372272083@qq.com |
772d21d44913d80d15596eec7a18966ffef5958f | 05e08bccc745c4c2e368c0b8dbcb2574ee610cb2 | /prep/practice_vidur/trees/print_kdistnode.cpp | 2f859b887ba2cd60d1bf6877873efc19f3253037 | [] | no_license | anurag95/MyCodes | 76dce681edd3fa8824dbe94d169d6e8ba4571175 | 9bd890306f6b10b60ca60a02c9f7e5765b5ac538 | refs/heads/master | 2021-01-10T13:52:30.866762 | 2015-11-18T12:41:37 | 2015-11-18T12:41:37 | 46,417,942 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,568 | cpp | #include <iostream>
using namespace std;
struct node{
int data;
node* left;
node* right;
};
node* new_node(int x){
node* temp = new node;
temp->data = x;
temp->left = NULL;
temp->right = NULL;
return temp;
}
void print_kdistdown(node* root, int k){
if(root == NULL)
return;
if(k == 0){
cout<<root->data<<" ";
return;
}
print_kdistdown(root->left, k - 1);
print_kdistdown(root->right, k - 1);
}
int print_kdistnode(node* root, node* target, int k){
if(root == NULL)
return -1;
if(root == target){
print_kdistdown(root, k);
return 0;
}
int dl = print_kdistnode(root->left, target, k);
if(dl != -1){
if(dl + 1 == k)
cout<<root->data<<" ";
else
print_kdistdown(root->right, k-dl-2);
return dl + 1;
}
int dr = print_kdistnode(root->right, target, k);
if(dr != -1){
if(dr + 1 == k)
cout<<root->data<<" ";
else
print_kdistdown(root->left, k-dr-2);
return dr + 1;
}
return -1;
}
void print(node* root){
if(root == NULL)
return;
print(root->left);
cout<<root->data<<" ";
print(root->right);
}
void remove(node* root){
if(root == NULL)
return;
remove(root->left);
remove(root->right);
delete root;
}
int main(){
node* root = new_node(20);
root->left = new_node(8);
root->right = new_node(22);
root->left->left = new_node(4);
root->left->right = new_node(12);
root->left->right->left = new_node(10);
root->left->right->right = new_node(14);
node *target = root->left->right;
int k = 2;
print(root);
cout<<endl;
print_kdistnode(root, target, k);
cout<<endl;
remove(root);
return 0;
} | [
"gupta.anu1995@gmail.com"
] | gupta.anu1995@gmail.com |
49718756f22c218e6feecfaaa33a5f9172916298 | 4084e4465b5f0a35103cfc93b92d64e5f3aca5a4 | /build-ElectronicMeasurementSys-Desktop_Qt_5_7_1_MSVC2013_32bit-Release/ui_aboutdlg.h | 6f0079d27d53ee0bb148f0abd14d92c76826d3f3 | [] | no_license | liuxuelian0114/ElectronicMeasurement | 643af42c2a778b8235c035c8233d27732d153acb | 9baf5af4032e54f3a5a8ceb2054bf0645b7f2d56 | refs/heads/master | 2022-04-23T15:38:39.396994 | 2020-04-22T23:59:42 | 2020-04-22T23:59:42 | 257,944,424 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,442 | h | /********************************************************************************
** Form generated from reading UI file 'aboutdlg.ui'
**
** Created by: Qt User Interface Compiler version 5.7.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_ABOUTDLG_H
#define UI_ABOUTDLG_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QDialog>
#include <QtWidgets/QFormLayout>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_AboutDlg
{
public:
QLabel *label;
QWidget *layoutWidget;
QFormLayout *formLayout;
QLabel *labelName;
QLabel *labelSoftName;
QLabel *labelVersion;
QLabel *labelSoftVersion;
void setupUi(QDialog *AboutDlg)
{
if (AboutDlg->objectName().isEmpty())
AboutDlg->setObjectName(QStringLiteral("AboutDlg"));
AboutDlg->resize(370, 142);
label = new QLabel(AboutDlg);
label->setObjectName(QStringLiteral("label"));
label->setGeometry(QRect(29, 34, 91, 71));
label->setPixmap(QPixmap(QString::fromUtf8(":/res/image/logo.ico")));
layoutWidget = new QWidget(AboutDlg);
layoutWidget->setObjectName(QStringLiteral("layoutWidget"));
layoutWidget->setGeometry(QRect(135, 42, 201, 61));
formLayout = new QFormLayout(layoutWidget);
formLayout->setObjectName(QStringLiteral("formLayout"));
formLayout->setHorizontalSpacing(3);
formLayout->setVerticalSpacing(15);
formLayout->setContentsMargins(6, 6, 6, 6);
labelName = new QLabel(layoutWidget);
labelName->setObjectName(QStringLiteral("labelName"));
formLayout->setWidget(0, QFormLayout::LabelRole, labelName);
labelSoftName = new QLabel(layoutWidget);
labelSoftName->setObjectName(QStringLiteral("labelSoftName"));
formLayout->setWidget(0, QFormLayout::FieldRole, labelSoftName);
labelVersion = new QLabel(layoutWidget);
labelVersion->setObjectName(QStringLiteral("labelVersion"));
formLayout->setWidget(1, QFormLayout::LabelRole, labelVersion);
labelSoftVersion = new QLabel(layoutWidget);
labelSoftVersion->setObjectName(QStringLiteral("labelSoftVersion"));
formLayout->setWidget(1, QFormLayout::FieldRole, labelSoftVersion);
retranslateUi(AboutDlg);
QMetaObject::connectSlotsByName(AboutDlg);
} // setupUi
void retranslateUi(QDialog *AboutDlg)
{
AboutDlg->setWindowTitle(QApplication::translate("AboutDlg", "Dialog", Q_NULLPTR));
label->setText(QString());
labelName->setText(QApplication::translate("AboutDlg", "\345\220\215\347\247\260\357\274\232", Q_NULLPTR));
labelSoftName->setText(QApplication::translate("AboutDlg", "\347\224\265\345\255\220\346\265\213\351\207\217\350\275\257\344\273\266", Q_NULLPTR));
labelVersion->setText(QApplication::translate("AboutDlg", "\347\211\210\346\234\254\357\274\232", Q_NULLPTR));
labelSoftVersion->setText(QApplication::translate("AboutDlg", "1.0.0", Q_NULLPTR));
} // retranslateUi
};
namespace Ui {
class AboutDlg: public Ui_AboutDlg {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_ABOUTDLG_H
| [
"1341386647@qq.com"
] | 1341386647@qq.com |
d247fb757419a90e10af13eb92653f9282a13588 | 31ccf8ef0662d1bd463766de6db3a72cb02bcabd | /endHostB_2.cpp | 36bbfe5dd1c797ef975d53e38c285571b235afb4 | [] | no_license | BaruchRosen/wet-exercise | 55d02dd9211d35b2d92918795110a1e60b4cfbde | 9fabab57051148db500e304c9c4f3cfff857d007 | refs/heads/master | 2020-04-09T04:24:10.656743 | 2019-01-02T21:24:44 | 2019-01-02T21:24:44 | 160,021,507 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,248 | cpp | // endHostB.cpp
#include "pch.h"
#include <iostream>
using namespace std;
#include<stdio.h>
#include<winsock2.h>
#include<string.h>
#pragma comment(lib,"ws2_32.lib") //Winsock Library
#pragma warning(disable : 4996)
#define SERVER "127.0.0.1" //ip address of udp server 127.0.0.1
#define BUFLEN 1000 //Max length of buffer
#define PORT 404 //The port on which to listen for incoming data
int main(void)
{
struct sockaddr_in si_other;
int s, slen = sizeof(si_other);
char buf[BUFLEN], IPA[] = { "127.0.0.1" };
char messageBM[BUFLEN],messageMB[BUFLEN],messageTest[BUFLEN];
WSADATA wsa;
//Initialise winsock
printf("\nInitialising Winsock...");
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
{
printf("Failed. Error Code : %d", WSAGetLastError());
exit(EXIT_FAILURE);
}
printf("\n Initialised.\n");
//create socket
if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == SOCKET_ERROR)
{
printf("socket() failed with error code : %d", WSAGetLastError());
exit(EXIT_FAILURE);
}
//setup address structure
memset((char *)&si_other, 0, sizeof(si_other));
si_other.sin_family = AF_INET;
si_other.sin_port = htons(PORT);
si_other.sin_addr.S_un.S_addr = inet_addr(SERVER);
if (sendto(s, "test", strlen(messageBM), 0, (struct sockaddr *) &si_other, slen) == SOCKET_ERROR)
{
printf("sendto() failed with error code : %d", WSAGetLastError());
//exit(EXIT_FAILURE);
}
//conection...
//fflush
if (recvfrom(s, buf, BUFLEN, 0, (struct sockaddr *) &si_other, &slen) == SOCKET_ERROR)
{
printf("recvfrom() failed with error code : %d", WSAGetLastError());
exit(EXIT_FAILURE);
}
printf("Message received: %s msgMB, data: dataAB",buf);
printf("\n enter message:\n");
scanf("%[^\n]%*c", messageBM);
//add ip of B
strcat(messageBM, " $$$ ");
strcat(messageBM, IPA);
if (sendto(s, messageBM, strlen(messageBM), 0, (struct sockaddr *) &si_other, slen) == SOCKET_ERROR)
{
printf("sendto() failed with error code : %d", WSAGetLastError());
exit(EXIT_FAILURE);
}
//clear the buffer by filling null, it might have previously received data
memset(buf, '\0', BUFLEN);
printf("Message sent: %s , data: dataBA" , messageBM);
scanf("%s", buf);
closesocket(s);
WSACleanup();
return 0;
}
| [
"barucha_rosen13@hotmail.com"
] | barucha_rosen13@hotmail.com |
09ceab1ae50c12e264082c2577bfa4c9d2b351ab | c8f168e1d67df9645ac335ef73375a0089458d92 | /Vjezbe_5/Analyzer.cpp | 35f4c6f64937f4612c208084712095f6367d51a3 | [] | no_license | mpavicicd/AnalizaHEP_Vjezbe | ca18555a0202ee3b811423d30907025f8a5f0e96 | 5af1cf8e36f38b84a77a31fcaa992431347efe26 | refs/heads/master | 2023-02-13T07:57:11.144305 | 2021-01-20T12:34:44 | 2021-01-20T12:34:44 | 301,999,344 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,605 | cpp | #define Analyzer_cxx
#include "Analyzer.h"
void Analyzer::Loop()
{
// In a ROOT session, you can do:
// root> .L Analyzer.C
// root> Analyzer t
// root> t.GetEntry(12); // Fill t data members with entry number 12
// root> t.Show(); // Show values of entry 12
// root> t.Show(16); // Read and show values of entry 16
// root> t.Loop(); // Loop on all entries
//
// This is the loop skeleton where:
// jentry is the global entry number in the chain
// ientry is the entry number in the current Tree
// Note that the argument to GetEntry must be:
// jentry for TChain::GetEntry
// ientry for TTree::GetEntry and TBranch::GetEntry
//
// To read only selected branches, Insert statements like:
// METHOD1:
// fChain->SetBranchStatus("*",0); // disable all branches
// fChain->SetBranchStatus("branchname",1); // activate branchname
// METHOD2: replace line
// fChain->GetEntry(jentry); //read all branches
//by b_branchname->GetEntry(ientry); //read only this branch
if (fChain == 0) return;
Long64_t nentries = fChain->GetEntriesFast();
Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
nb = fChain->GetEntry(jentry); nbytes += nb;
// if (Cut(ientry) < 0) continue;
//cout << *Ime1 << endl;
}
}
void Analyzer::PlotHistogram() //fja za crtanje histograma
{
//cestice raspada kao elementi klase TLorentzVector
TLorentzVector *pocetna;
pocetna = new TLorentzVector();;
/*inicijalizacija i postavljanje histograma*/
TH1F *histo1, *histo2, *histo3;
//pozivanje konstruktora (name of histogram, histogram title, number of bins, low edge of first bin, upper edge of last bin)
histo1 = new TH1F("Histogram1", "Decay particles transverse momentum", 75, 0, 150);
histo2 = new TH1F("Histogram2", "Decay particles transverse momentum", 75, 0, 150);
histo3 = new TH1F("Histogram3", "Higgs boson transverse momentum", 75, 0, 150);
//petlja koja puni histogram podacima
if (fChain == 0) return;
Long64_t nentries = fChain->GetEntriesFast();
Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
nb = fChain->GetEntry(jentry); nbytes += nb;
pocetna->SetPxPyPzE(px1 + px2, py1 + py2, pz1 + pz2, En1 + En2); //stvaranje 4-vektora
histo1->Fill(pT1);
histo2->Fill(pT2);
//ispuni treci histogram s p_T pocetne cestice
histo3->Fill(pocetna->Pt());
}
/*uredivanje svojstava histograma*/
histo1->GetXaxis()->SetTitle("p_{T} [GeV]"); //postavlja oznaku na x-osi
histo1->GetYaxis()->SetTitle("Events / 2 GeV"); //postavlja oznaku na y-osi
histo3->GetXaxis()->SetTitle("p_{T} [GeV]");
histo3->GetYaxis()->SetTitle("Events / 2 GeV");
histo1->SetLineColor(2); //postavlja boju linije
histo2->SetLineColor(4);
histo3->SetLineColor(3);
//boje navedene na https://root.cern.ch/doc/master/classTAttLine.html
histo1->SetFillStyle(1001); //postavlja stil ispune
histo1->SetFillColor(2); //postavlja boju ispune
histo3->SetFillStyle(1001); //postavlja stil ispune
histo3->SetFillColor(3); //postavlja boju ispune
//boje i stil navedeni na https://root.cern.ch/doc/master/classTAttFill.html
histo3->SetMaximum(350);
//gStyle->SetOptStat("n"); //u opisu ispisi samo naziv histograma
gStyle->SetOptStat(0); //uklanja statisticki opis
/*dodavanje legende - https://root.cern.ch/doc/master/classTLegend.html*/
TLegend *leg1, *leg2;
//pozivanje konstruktora za legendu
//(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char* header = "", Option_t* option = "brNDC")
//x1,y1,x2,y2 - the coordinates of the Legend in the current pad
//header - the title displayed at the top of the legend (default is no header (header = 0))
//options - defines looks of the box, more at https://root.cern.ch/doc/master/classTPave.html#ac9ec1ee85b11f589e9a24c609872095d
leg1 = new TLegend(0.6,0.78,0.9,0.9,"Simulation results");
leg2 = new TLegend(0.1,0.83,0.58,0.9,"Calculation from the simulation results");
leg1->SetTextSize(.03); //postavljanje velicine teksta - izrazeno u postotku velicine trenutkog odjeljka
leg2->SetTextSize(.03);
//povezivanje legende s histogramom (naziv histograma, labela, opcija)
leg1->AddEntry(histo1, "1st decay particle", "f");
leg1->AddEntry(histo2, "2nd decay particle", "f");
leg2->AddEntry(histo3, "Higgs boson", "f");
TCanvas *canv; //stvaranje platna
//pozivanje konstruktora za platno
/*(const char* name, const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh)
name - canvas name
title - canvas title
wtopx,wtopy - pixel coordinates of the top left corner of the canvas (if wtopx < 0 the menubar is not shown)
ww - canvas size in pixels along X
wh - canvas size in pixels along Y*/
canv = new TCanvas("c1","Profile histogram example",200, 10,700,500);
canv->Divide(2,1); //podjela platna na 2 stupca, 1 redak
//crtanje na lijevoj strani platna
canv->cd(1); //postavljanje prvog odjeljka ("pad") kao aktivnog
histo1->Draw(); //nacrtaj histogram na danom platnu
histo2->Draw("same"); //same - crtaj na istom platnu
leg1->Draw(); //nacrtaj legendu na danom platnu
//crtanje na desnoj strani platna
canv->cd(2);
histo3->Draw();
leg2->Draw();
canv->SaveAs("Histogram_Z5.pdf"); //spremi platno kao...
canv->SaveAs("Histogram_Z5.png"); //spremi platno kao...
canv->SaveAs("Histogram_Z5.root"); //spremi platno kao...
delete histo1; //brisanje pokazivaca
delete histo2;
delete histo3;
delete pocetna;
}
| [
"mpavicicd@pmfst.hr"
] | mpavicicd@pmfst.hr |
cd87027456a19bf74f02ef9bf9f2c866ccdd501d | 56eb82d45b5c615e59230ede6faa3b52cd2f7b45 | /AC_Record/XJOI 1065.cpp | a478372310c586fef93f192947963180fd8b31b0 | [] | no_license | chy-2003/reponame | 3b689d95d088b15ce710f5072561ad2a20a29388 | 15f64e72149604b72e56640909eb8eb2e5e276b2 | refs/heads/master | 2020-03-22T08:51:46.947871 | 2018-12-21T07:57:41 | 2018-12-21T07:57:41 | 139,796,633 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 801 | cpp | #include<bits/stdc++.h>
#define LL long long
using namespace std;
LL s, t, n, m, a[100010], b[100010], c[100010], dis[100010], vis[100010], rec[100010];
void p(long long t){
if(t == 0) return;
p(rec[t]);
printf("%lld ", t);
return;
}
int main(){
scanf("%lld%lld", &s, &t);
scanf("%lld%lld", &n, &m);
for(LL i = 1; i <= m; i++) scanf("%lld%lld%lld", &a[i], &b[i], &c[i]);
memset(dis, 255, sizeof(dis));
for(LL i = 1; i <= n; i++) rec[i] = 1010;
dis[s] = 0;
vis[s] = 0;
rec[s] = 0;
for(LL i = 1; i <= n; i++)
for(LL j = 1; j <= m; j++)
if(dis[a[j]] > -1)
if(dis[b[j]] < dis[a[j]] + c[j] || dis[b[j]] == dis[a[j]] + c[j] && a[j] < rec[b[j]]){
rec[b[j]] = a[j];
dis[b[j]] = dis[a[j]] + c[j];
}
printf("%lld\n", dis[t]);
p(t);
return 0;
} | [
"528574785@qq.com"
] | 528574785@qq.com |
f8d60ebe6be82e37099967cd1d9cab02f9081835 | 9d690da2e4cc9f3545e49f8b70dc12f56eb68b12 | /Modelska Analiza/208/fem/delitev_arpack.cpp | 6c72ba0c5982fef2d902f8cb11146a7ea45deb88 | [] | no_license | Noughmad/Sola | 39fc9b89638edeb4ac050597f68ddd5159f6e7ad | 6c3649851e91748f36f82cb6b53118d675bc873d | refs/heads/master | 2020-05-17T07:54:30.092279 | 2013-09-03T09:38:35 | 2013-09-03T09:38:35 | 3,193,047 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 996 | cpp | #include "delitev.h"
#if defined WITH_ARPACK
#include "areig.h"
#endif
int lastne_arpack(double EigVal[], double EigVec[], int n, int nnz, double A[],
int irow[], int pcol[], char uplo, int nev,
char* which)
{
#if defined WITH_ARPACK
return AREig<double>(EigVal, EigVec, n, nnz, A, irow, pcol, uplo, nev, which);
#else
return 0;
#endif
}
int lastne(double EigVal[], double EigVec[], int n, int nnz, cholmod_sparse* A, int nev, char* which)
{
return lastne_arpack(EigVal, EigVec, n, nnz, A->x, A->i, A->p, (A->stype == 1) ? 'U' : 'L', nev, which);
}
int lastne_gen(double EigVal[], double EigVec[], int n, int nnzA, cholmod_sparse* A, int nnzB, cholmod_sparse* B, int nev, char* which)
{
#if defined WITH_ARPACK
return AREig<double>(EigVal, EigVec, n, nnzA, (double*)A->x, (int*)A->i, (int*)A->p,
nnzB, (double*)B->x, (int*)B->i, (int*)B->p, (A->stype == 1) ? 'U' : 'L', nev, which);
#else
return 0;
#endif
}
| [
"miha@noughmad.eu"
] | miha@noughmad.eu |
b6e868d73cfb3740046772298b6153674b38c22a | 30ce7f16cff959daf5bd80b12f51c1dfda72005f | /srcs/States/SoloModeGameState.cpp | bda1b40fb435a605f5ae50f2e00a6efcbac19a24 | [] | no_license | imadKimouche/Indie-Studio | 7d06e6ce288d6d3833f09496788a0931b8263f12 | 35b94553bf987f91eb146502b1e42df6e9204658 | refs/heads/master | 2020-03-24T08:41:00.731359 | 2019-09-24T11:16:57 | 2019-09-24T11:16:57 | 142,603,981 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 812 | cpp | /*
** EPITECH PROJECT, 2018
** IndieStudio
** File description:
** SoloModeGameState.cpp
*/
#include "States/SoloModeGameState.hpp"
SoloModeGameState::SoloModeGameState(BombermanProtocol *bomberman)
{
this->_bomberman = bomberman;
this->_actualScene = new SoloModeGameScene(this);
}
SoloModeGameState::~SoloModeGameState()
{
}
void SoloModeGameState::start()
{
_actualScene->start();
}
void SoloModeGameState::update()
{
_actualScene->update();
}
void SoloModeGameState::changeScene(IScene *newScene)
{
//delete _actualScene;
this->_actualScene = newScene;
}
void SoloModeGameState::changeState(IState *newState)
{
_bomberman->changeState(newState);
}
BombermanProtocol *SoloModeGameState::getProtocol()
{
return this->_bomberman;
}
void SoloModeGameState::restart()
{
_bomberman->restart();
}
| [
"imad.kimouche@epitech.eu"
] | imad.kimouche@epitech.eu |
24eae06f62e7913c4be6d014849b13cd606447fe | 2efbd55f9c7f39bddc1348f3a9d38a8f05d0644a | /plugins/eeui/WeexSDK/ios/weex_core/Source/include/JavaScriptCore/runtime/JSGlobalObjectInlines.h | 351681d8b2ee6ec0665e2f03b71668dfbb40c2fa | [
"MIT"
] | permissive | bonniesl/yktapp | 23b05cc53214269bf1d792dcf41993b425bfe470 | 3f96b7aad945e9aa110f0643d9a57e28d0645ab6 | refs/heads/master | 2023-03-27T04:27:14.921221 | 2021-03-25T06:29:16 | 2021-03-25T06:33:12 | 351,330,677 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,850 | h | /*
* Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "JSGlobalObject.h"
#include "ArrayPrototype.h"
#include "ObjectPrototype.h"
namespace JSC {
ALWAYS_INLINE bool JSGlobalObject::objectPrototypeIsSane()
{
return !hasIndexedProperties(m_objectPrototype->indexingType())
&& m_objectPrototype->getPrototypeDirect().isNull();
}
ALWAYS_INLINE bool JSGlobalObject::arrayPrototypeChainIsSane()
{
return !hasIndexedProperties(m_arrayPrototype->indexingType())
&& m_arrayPrototype->getPrototypeDirect() == m_objectPrototype.get()
&& objectPrototypeIsSane();
}
ALWAYS_INLINE bool JSGlobalObject::stringPrototypeChainIsSane()
{
return !hasIndexedProperties(m_stringPrototype->indexingType())
&& m_stringPrototype->getPrototypeDirect() == m_objectPrototype.get()
&& objectPrototypeIsSane();
}
ALWAYS_INLINE bool JSGlobalObject::isArrayIteratorProtocolFastAndNonObservable()
{
// We're fast if we don't have any indexed properties on the prototype.
// We're non-observable if the iteration protocol hasn't changed.
//
// Note: it only makes sense to call this from the main thread. If you're
// trying to prove this behavior on the compiler thread, you'll want to
// carefully set up watchpoints to have correct ordering while JS code is
// executing concurrently.
return arrayIteratorProtocolWatchpoint().isStillValid() && !isHavingABadTime() && arrayPrototypeChainIsSane();
}
} // namespace JSC
| [
"1336429771@qq.com"
] | 1336429771@qq.com |
cee9d29ebae67ad25aaece001bfcb63f035886af | d41fdca1bc40c51dd0a98fff976ff48b05201e6a | /AnimalFarm.cpp | cfb49c02f420645b60912516a5198f26594fedec | [] | no_license | 1997YJ/Happy-Farm-Game | 1e47f1c2e596971b4e0a8eb64ff87fae6d3a7b75 | 7bb6157ca73066cbfbfa754103b6bb4c9efccab0 | refs/heads/master | 2020-11-27T00:57:45.421980 | 2019-12-20T13:00:32 | 2019-12-20T13:00:32 | 229,249,975 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,421 | cpp | #include "AnimalFarm.h"
int maxNum = 5;
Music* AnimalFarm::muAnimalFarm = NULL;
AnimalFarm::AnimalFarm()
{
// numChicken = 0
// numCow = 0
// numPig = 0
// numZombie = 0
}
AnimalFarm::AnimalFarm(Factory* aFact,AchievementArray* s,Condition* status):aFact(aFact),s(s),status(status)
{
// numChicken = 0;
// numCow = 0;
// numPig = 0;
// numZombie = 0;
}
void AnimalFarm::loadImage(SDL_Renderer *rR)
{
tAnimalFarm = new Texture;
tAnimalFarm->LoadImagePNG("hen2", rR);
tAnimalFarm->LoadImagePNG("cow2", rR);
tAnimalFarm->LoadImagePNG("pig2", rR);
tAnimalFarm->LoadImagePNG("zombie2", rR);
tAnimalFarm->LoadImagePNG("animalfarmbg", rR);
}
bool AnimalFarm::add(string animalName)
{
int animalIndex = -1;
if (animalName == "chicken")
{
animalIndex = 0;
}
else if (animalName == "cow")
{
animalIndex = 1;
}
else if (animalName == "pig")
{
animalIndex = 2;
}
else if (animalName == "zombie")
{
animalIndex = 3;
}
if (numAnimal[animalIndex] < maxNum) // < 4 (5)
{
Animal* aAnimal = new Animal(animalIndex);
animalList.push(aAnimal);
numAnimal[animalIndex]++;
return true;
}
else
{
cout << "There are already 5 chickens, can not add more!!!" << endl;
return false;
}
}
void AnimalFarm::detectDeadRemove()
{
if (animalList.getLengh() > 0)
{
for (int i = 1; i < animalList.getLengh() + 1; i++)
// 0 ~ numChicken-1 (not more than 5 times)
{
cout << "start detect : " << endl;
if (animalList[i]->getIsDead())
{
cout << "has get IsDead" << endl;
remove(i);
}
cout << "finish detect" << endl;
}
}
}
void AnimalFarm::remove(int index)
{
numAnimal[animalList[index]->farmIndex]--;
animalList.remove(index);
muAnimalFarm->PlayChunk(Music::cNOTREACH);
}
void AnimalFarm::drawAnimalFarm(SDL_Renderer* rR)
{
// draw background
tAnimalFarm->Draw(rR, 0, 0, 720, 1280, 4); // animalfarmbg
// draw animals
int chickenX = 0;
int cowX = 0;
int pigX = 0;
int zombieX = 0;
aFact->productList[5]->drawProduct(rR, 813, 630, 100, 100);
aFact->productList[7]->drawProduct(rR, 913, 630, 100, 100);
aFact->productList[13]->drawProduct(rR, 1013, 630, 100, 100);
aFact->productList[32]->drawProduct(rR, 1113, 630, 100, 100);
int f[4] = {5,7,13,32};
for (int i = 0; i < 4; i++) {
// if (!aFact->productList[f[i]]->isGot()){ // if not got
// aFact->tFactory->Draw(rR, 0, 0, 90, 90, 813+110*(i), 630, 12);
// }
int num3 = aFact->productList[f[i]]->onHand();
if (num3 >= 100){
int num1 = num3 / 100;
num3 -= num1*100;
aFact->tFactory->Draw(rR, 0, 0, 32, 32, 838+110*(i), 680, num1);
}
if (num3 >= 10){
int num2 = num3 / 10;
num3 -= num2*10;
aFact->tFactory->Draw(rR, 0, 0, 32, 32, 858+110*(i), 680, num2);
}
aFact->tFactory->Draw(rR, 0, 0, 32, 32, 888+110*(i), 680, num3);
}
for (int i = 1;i < animalList.getLengh()+1; i++)
{
switch (animalList[i]->farmIndex)
{
case 0:
if(animalList[i]->isProducing)
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * chickenX + 50, 200, 0);
else
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * chickenX + 50+rand()%4*4, 200, 0);
chickenX++;
break;
case 1:
if(animalList[i]->isProducing)
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * (cowX + 5) + 50, 200, 1);
else
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * (cowX + 5) + 50, 200+rand()%4*4, 1);
cowX++;
break;
case 2:
if(animalList[i]->isProducing)
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * pigX + 50, 500, 2);
else
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * pigX + 50, 500+rand()%4*4, 2);
pigX++;
break;
case 3:
if(animalList[i]->isProducing)
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * (zombieX + 5) + 50, 500, 3);
else
tAnimalFarm->Draw(rR, 0, 0, 100, 100, 120 * (zombieX + 5) + 50+rand()%4*4, 500, 3);
zombieX++;
break;
default:
break;
}
}
}
void AnimalFarm::feed(int index)
{
cout<< animalList[index]->feedIndex<<endl;
if (aFact->productList[animalList[index]->feedIndex]->available())
{
if(animalList[index]->feed()){
aFact->productList[animalList[index]->feedIndex]->remove(1);
if(animalList[index]->feedIndex==5)
muAnimalFarm->PlayChunk(Music::cCHICKEN);
else if(animalList[index]->feedIndex==7)
muAnimalFarm->PlayChunk(Music::cCOW);
else if(animalList[index]->feedIndex==13)
muAnimalFarm->PlayChunk(Music::cPIG);
else if(animalList[index]->feedIndex==32)
muAnimalFarm->PlayChunk(Music::cZOMBIE);
}
}
else
muAnimalFarm->PlayChunk(Music::cNOFEED);
}
void AnimalFarm::produce()
{
for(int index = 1; index < animalList.getLengh()+1; index++)
if(animalList[index]->produce())
{
aFact->productList[animalList[index]->animalIndex]->add(1);
s->ACHIEVEMENTARRAY[animalList[index]->animalIndex].add(status);
muAnimalFarm->PlayChunk(Music::cEXP);
}
}
void AnimalFarm::updateAnimalFarm(int x, int y, bool mouseL)
{
detectDeadRemove();
produce();
int chickenX = 0;
int cowX = 0;
int pigX = 0;
int zombieX = 0;
for (int i = 1;i < animalList.getLengh() + 1; i++)
{
switch (animalList[i]->farmIndex)
{
case 0:
if ((120 * chickenX + 50 < x) && (120 * chickenX + 50 + 100 > x) && (200 < y) && (200 + 100 > y) && mouseL)
{
feed(i);
}
chickenX++;
break;
case 1:
if ((120 * (cowX + 5) + 50 < x) && (120 * (cowX + 5) + 50 + 100 > x) && (200 < y) && (200 + 100 > y) && mouseL)
{
feed(i );
}
cowX++;
break;
case 2:
if ((120 * pigX + 50 < x) && (120 * pigX + 50 + 100 > x) && (500 < y) && (500 + 100 > y) && mouseL)
{
feed(i );
}
pigX++;
break;
case 3:
if ((120 * (zombieX + 5) + 50 < x) && (120 * (zombieX + 5) + 50 + 100 > x) && (500 < y) && (500 + 100 > y) && mouseL)
{
feed(i );
}
zombieX++;
break;
default:
break;
}
}
}
| [
"yenyenhsu0709@gmail.com"
] | yenyenhsu0709@gmail.com |
095c6c28575ccac068f7b1f4d1fd2410a983cccb | 5ddd0ec20099a9c3ffe865c835dcceb5b7fd0332 | /of_v0.8.0_vs_release-gesture-recognizer/apps/myApps/GRT_Predict/src/GrabProxie.h | d5fb6162946609ec66157f8b991081e5c222c73a | [
"MIT"
] | permissive | MarkusKonk/Geographic-Interaction | af81f9f4c7c201dd55843d4dd0d369f2f407d480 | b74f6f04656611df8dc4ebdea43f263cea67b366 | refs/heads/master | 2020-12-30T10:36:34.414880 | 2014-02-03T12:37:45 | 2014-02-03T12:37:45 | 13,868,029 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 838 | h | #include "GrabDetector.h";
#include <NiTE.h>
using namespace nite;
#pragma once
class GrabProxie
{
public:
GrabProxie(void);
~GrabProxie(void);
PSLabs::IGrabDetector* m_grabDetector;
openni::Status GrabProxie::initGrabDetector( openni::Device &m_device );
void processGrabEvent( PSLabs::IGrabEventListener::GrabEventType Type );
void GrabProxie::updateAlgorithm(bool &handlost, bool &handTracked, Point3f &handCoord, openni::VideoFrameRef& m_depthFrame, openni::VideoFrameRef& m_colorFrame);
class GrabEventListener : public PSLabs::IGrabEventListener
{
public:
GrabEventListener(GrabProxie* proxie) : m_proxie(proxie)
{
}
virtual void DLL_CALL ProcessGrabEvent( const EventParams& params )
{
m_proxie->processGrabEvent(params.Type);
}
GrabProxie* m_proxie;
};
GrabEventListener* m_grabListener;
};
| [
"matthias.m.hinz@googlemail.com"
] | matthias.m.hinz@googlemail.com |
06f82e112e92e3002f17d529ac9373eb7dc780cc | 933f10aba2555e3d72221eff0099b6dfc0976f80 | /documentation/source/Body.h | d8aab036a5d3b869172e4a1cac3b0d2bd07f647e | [] | no_license | jluttine/ipag | b9b4981bbca18ac7bbf1367bc6875f5a74e37532 | 0b4dfcdde9bc08702121f06b18b51b98c015c0a7 | refs/heads/master | 2021-01-25T08:42:30.863835 | 2013-03-21T01:53:45 | 2013-03-21T01:53:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,130 | h |
#ifndef _BODY_H_
#define _BODY_H_
class Body;
#include "Coordinates.h"
#include "World.h"
#include "Graphics.h"
/**
* Author: Jaakko Luttinen
* Body is a class for all the bodies in the world. All bodies are
* considered as circle shaped. Bodies can have mass and they can emit
* gravitational field. Body is always in some world and it cannot be
* changed. World will clean the memory allocation of the body. Body has a
* visualization.
*/
class Body
{
public:
/**
* Constructs a new body.
* @param world The world which the body will be put into. Note,
* constructor does NOT add the body into the world
* automatically.
* @param x X-coordinate of the body's center in the world.
* @param y Y-coordinate of the body's center in the world.
* @param radius The radius of the body.
* @param mass The mass of the body.
* @param emitGravitation Tells whether body emits gravitational field.
* @param collidable Tells whether body is collidable.
*/
Body( World &world, float x, float y, float radius, float mass,
bool emitGravitation, bool collidable );
/**
* Destructs the body.
*/
virtual ~Body();
/**
* Body cannot remove itself from the world, so it must raise a flag which
* will be read by the world. World then removes the body and frees body's
* memory allocation.
*/
inline virtual void destroy() { this->destroyed = true; };
/**
* Tells whether the body is destroyed and should be removed from the
* world.
* @return Tells whether the body is destroyed.
*/
inline bool isDestroyed() const { return this->destroyed; };
/**
* Game engine may use action flag to determine whether the body is an
* action body and should be waited to finish its action. After all action
* bodies are destroyed the game itself will continue.
* @param action Tells whether the body is an action body.
*/
inline void setActionFlag( bool action ) { this->actionFlag = action; };
/**
* Tells whether the body has action flag set.
* @return Tells whether body has action flag set.
*/
inline bool getActionFlag() const { return this->actionFlag; };
/**
* Two bodies may collide only if the other or both bodies are collidable.
* No collision will occur if both are non-collidable.
* @param collidable Tells whether the body is collidable.
*/
inline void setCollidable( bool collidable )
{ this->collidable = collidable; };
/**
* Tells whether the body is collidable.
* @return Tells whether the body is collidable.
*/
inline bool isCollidable() const { return this->collidable; };
/**
* Sets the radius of the body.
* @param radius The radius of the body.
*/
inline void setRadius( float radius ) { this->radius = radius; };
/**
* Tells the radius of the body.
* @return The radius of the body.
*/
inline float getRadius() const { return this->radius; };
/**
* Sets the mass of the body. If mass is zero, no gravitational field will
* affect the body.
* @param mass The mass of the body.
*/
inline void setMass( float mass ) { this->mass = mass; };
/**
* Tells the mass of the body.
* @return The mass of the body.
*/
inline float getMass() const { return this->mass; };
/**
* Tells whether the body emits gravitational field.
* @return Tells whether the body emits gravitational field.
*/
inline bool emitsGravitation() { return this->emitGravitation; };
/**
* Tells the phase of the body (0-1). What the phase exactly tells, is
* undefined and may be used differently by subclasses. Phase will be used
* in drawing the sprite.
* @return The phase of the body (0-1).
*/
virtual inline float getPhase() const { return .0; };
/**
* Tells the world which the body is in.
* @return Tells the world which the body is in.
*/
inline World& getWorld() const { return this->world; };
/**
* Sets the location of the body.
* @param x X-coordinate.
* @param y Y-coordinate.
*/
inline void setLocation( float x, float y )
{ this->location.set( x, y ); };
/**
* Tells the location of the body.
* @return Location of the body.
*/
inline const Coordinates& getLocation() const { return this->location; };
/**
* Tells whether the body and given body collide. Two bodies will collide
* if all the following circumstances are met:
* 1) Bodies are in the same world.
* 2) At least one of the bodies is collidable.
* 3) None of the bodies is destroyed.
* 4) The circles of the bodies collide in the world.
* @param testBody The body to determine the collision with.
* @return Tells whether the bodies collide.
*/
bool collisionDetection( Body &testBody ) const;
/**
* When two bodies collide (determined by collisionDetection function)
* their collide functions are called to simulate the collision.
* @param collidingBody The other body in collision.
*/
virtual void collide( Body &collidingBody ) { };
/**
* Tells the gravitational field the body creates in a specific location.
* @param vector The vector to store the gravitational field.
* @param x The x-coordinate of the location.
* @param y The y-coordinate of the location.
*/
void getGravitationalField( Vector &vector, float x, float y );
/**
* This function will be called with short delays to simulate the body in
* the world.
* @param timestep Delay since last call in milliseconds.
*/
virtual void step( unsigned int timestep ) { };
/**
* This function will be called after a round in game. Body may do its
* procedures.
* @param step The step length (0-1). This function may called many times
* to make simulation fluent. For example, four calls with
* parameters 0.2, 0.2, 0.3 and 0.3 will make a whole 1.0 end
* of round.
*/
virtual void endOfRound( float step ) { };
/**
* Visualizes the body to the given graphics system.
* @param graphics The graphics system.
*/
virtual void draw( Graphics &graphics );
protected:
/**
* The index of the sprite.
*/
int sprite;
/**
* The world which the body is in.
*/
World &world;
/**
* The location of the body.
*/
Coordinates location;
private:
/**
* The mass of the body.
*/
float mass;
/**
* The radius of the body.
*/
float radius;
/**
* As long as at least one action body is in the world, action phase
* continues.
*/
bool actionFlag;
/**
* Tells whether body emits gravtitational field.
*/
bool emitGravitation;
/**
* Tells whether body is collidable. Two bodies may collide if the other
* or both bodies are collidable.
*/
bool collidable;
/**
* Tells whether body is destroyed and should be removed from the world.
*/
bool destroyed;
};
#endif //_BODY_H_
| [
"jaakko.luttinen@iki.fi"
] | jaakko.luttinen@iki.fi |
65a729e6d050037df0b9c10617849839219b95b1 | 5c9d6e77bae80ff3f563b2a670ab3cb958ba4bf8 | /submit/lab10/exercises/1-fact/test-main.cc | f1a97adca0ef7671ddb742f78d5663ee13490f0f | [] | no_license | ben5168/i240a | 955d60750b9994b36252135fa77f87141e26bae9 | 655391a1e432ed38af82a61dca69d15e8aef2bf4 | refs/heads/master | 2020-12-19T21:02:39.438287 | 2020-05-06T21:49:11 | 2020-05-06T21:49:11 | 235,851,743 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 344 | cc | //This tells Catch to provide a main() - only do this in one cpp file
#define CATCH_CONFIG_MAIN
#include "catch.hh"
#include "fact.hh"
TEST_CASE( "Factorials are computed", "[fact]" ) {
REQUIRE( fact(0) == 1 );
REQUIRE( fact(1) == 1 );
REQUIRE( fact(2) == 2 );
REQUIRE( fact(3) == 6 );
REQUIRE( fact(10) == 3628800 );
}
| [
"bmarti38@binghamton.edu"
] | bmarti38@binghamton.edu |
8d5bdb18f1a4ad6839965236eec4bb24df2ea71f | 04e5b6df2ee3bcfb7005d8ec91aab8e380333ac4 | /clang_codecompletion/clang/Serialization/AttrPCHWrite.inc | 4f8dc26ba6bb45a62526d5d4fe69509787958a81 | [
"MIT"
] | permissive | ColdGrub1384/Pyto | 64e2a593957fd640907f0e4698d430ea7754a73e | 7557485a733dd7e17ba0366b92794931bdb39975 | refs/heads/main | 2023-08-01T03:48:35.694832 | 2022-07-20T14:38:45 | 2022-07-20T14:38:45 | 148,944,721 | 884 | 157 | MIT | 2023-02-26T21:34:04 | 2018-09-15T22:29:07 | C | UTF-8 | C++ | false | false | 83,248 | inc | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Attribute serialization code *|
|* *|
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
switch (A->getKind()) {
case attr::AArch64VectorPcs: {
const auto *SA = cast<AArch64VectorPcsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AMDGPUFlatWorkGroupSize: {
const auto *SA = cast<AMDGPUFlatWorkGroupSizeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getMin());
Record.AddStmt(SA->getMax());
break;
}
case attr::AMDGPUNumSGPR: {
const auto *SA = cast<AMDGPUNumSGPRAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getNumSGPR());
break;
}
case attr::AMDGPUNumVGPR: {
const auto *SA = cast<AMDGPUNumVGPRAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getNumVGPR());
break;
}
case attr::AMDGPUWavesPerEU: {
const auto *SA = cast<AMDGPUWavesPerEUAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getMin());
Record.AddStmt(SA->getMax());
break;
}
case attr::ARMInterrupt: {
const auto *SA = cast<ARMInterruptAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getInterrupt());
break;
}
case attr::AVRInterrupt: {
const auto *SA = cast<AVRInterruptAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AVRSignal: {
const auto *SA = cast<AVRSignalAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AbiTag: {
const auto *SA = cast<AbiTagAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->tags_size());
for (auto &Val : SA->tags())
Record.AddString(Val);
break;
}
case attr::AcquireCapability: {
const auto *SA = cast<AcquireCapabilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::AcquireHandle: {
const auto *SA = cast<AcquireHandleAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getHandleType());
break;
}
case attr::AcquiredAfter: {
const auto *SA = cast<AcquiredAfterAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::AcquiredBefore: {
const auto *SA = cast<AcquiredBeforeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::AddressSpace: {
const auto *SA = cast<AddressSpaceAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getAddressSpace());
break;
}
case attr::Alias: {
const auto *SA = cast<AliasAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getAliasee());
break;
}
case attr::AlignMac68k: {
const auto *SA = cast<AlignMac68kAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AlignNatural: {
const auto *SA = cast<AlignNaturalAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AlignValue: {
const auto *SA = cast<AlignValueAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getAlignment());
break;
}
case attr::Aligned: {
const auto *SA = cast<AlignedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->isAlignmentExpr());
if (SA->isAlignmentExpr())
Record.AddStmt(SA->getAlignmentExpr());
else
Record.AddTypeSourceInfo(SA->getAlignmentType());
break;
}
case attr::AllocAlign: {
const auto *SA = cast<AllocAlignAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getParamIndex().serialize());
break;
}
case attr::AllocSize: {
const auto *SA = cast<AllocSizeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getElemSizeParam().serialize());
Record.push_back(SA->getNumElemsParam().serialize());
break;
}
case attr::AlwaysDestroy: {
const auto *SA = cast<AlwaysDestroyAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AlwaysInline: {
const auto *SA = cast<AlwaysInlineAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AnalyzerNoReturn: {
const auto *SA = cast<AnalyzerNoReturnAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Annotate: {
const auto *SA = cast<AnnotateAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getAnnotation());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::AnyX86Interrupt: {
const auto *SA = cast<AnyX86InterruptAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AnyX86NoCallerSavedRegisters: {
const auto *SA = cast<AnyX86NoCallerSavedRegistersAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AnyX86NoCfCheck: {
const auto *SA = cast<AnyX86NoCfCheckAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ArcWeakrefUnavailable: {
const auto *SA = cast<ArcWeakrefUnavailableAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ArgumentWithTypeTag: {
const auto *SA = cast<ArgumentWithTypeTagAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getArgumentKind());
Record.push_back(SA->getArgumentIdx().serialize());
Record.push_back(SA->getTypeTagIdx().serialize());
Record.push_back(SA->getIsPointer());
break;
}
case attr::ArmBuiltinAlias: {
const auto *SA = cast<ArmBuiltinAliasAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getBuiltinName());
break;
}
case attr::ArmMveStrictPolymorphism: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Artificial: {
const auto *SA = cast<ArtificialAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::AsmLabel: {
const auto *SA = cast<AsmLabelAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getLabel());
Record.push_back(SA->getIsLiteralLabel());
break;
}
case attr::AssertCapability: {
const auto *SA = cast<AssertCapabilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::AssertExclusiveLock: {
const auto *SA = cast<AssertExclusiveLockAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::AssertSharedLock: {
const auto *SA = cast<AssertSharedLockAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::AssumeAligned: {
const auto *SA = cast<AssumeAlignedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getAlignment());
Record.AddStmt(SA->getOffset());
break;
}
case attr::Assumption: {
const auto *SA = cast<AssumptionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getAssumption());
break;
}
case attr::Availability: {
const auto *SA = cast<AvailabilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getPlatform());
Record.AddVersionTuple(SA->getIntroduced());
Record.AddVersionTuple(SA->getDeprecated());
Record.AddVersionTuple(SA->getObsoleted());
Record.push_back(SA->getUnavailable());
Record.AddString(SA->getMessage());
Record.push_back(SA->getStrict());
Record.AddString(SA->getReplacement());
Record.push_back(SA->getPriority());
break;
}
case attr::BPFPreserveAccessIndex: {
const auto *SA = cast<BPFPreserveAccessIndexAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::BTFDeclTag: {
const auto *SA = cast<BTFDeclTagAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getBTFDeclTag());
break;
}
case attr::BTFTypeTag: {
const auto *SA = cast<BTFTypeTagAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getBTFTypeTag());
break;
}
case attr::Blocks: {
const auto *SA = cast<BlocksAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getType());
break;
}
case attr::Builtin: {
const auto *SA = cast<BuiltinAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getID());
break;
}
case attr::BuiltinAlias: {
const auto *SA = cast<BuiltinAliasAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getBuiltinName());
break;
}
case attr::C11NoReturn: {
const auto *SA = cast<C11NoReturnAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CDecl: {
const auto *SA = cast<CDeclAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CFAuditedTransfer: {
const auto *SA = cast<CFAuditedTransferAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CFConsumed: {
const auto *SA = cast<CFConsumedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CFGuard: {
const auto *SA = cast<CFGuardAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getGuard());
break;
}
case attr::CFICanonicalJumpTable: {
const auto *SA = cast<CFICanonicalJumpTableAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CFReturnsNotRetained: {
const auto *SA = cast<CFReturnsNotRetainedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CFReturnsRetained: {
const auto *SA = cast<CFReturnsRetainedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CFUnknownTransfer: {
const auto *SA = cast<CFUnknownTransferAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CPUDispatch: {
const auto *SA = cast<CPUDispatchAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->cpus_size());
for (auto &Val : SA->cpus())
Record.AddIdentifierRef(Val);
break;
}
case attr::CPUSpecific: {
const auto *SA = cast<CPUSpecificAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->cpus_size());
for (auto &Val : SA->cpus())
Record.AddIdentifierRef(Val);
break;
}
case attr::CUDAConstant: {
const auto *SA = cast<CUDAConstantAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CUDADevice: {
const auto *SA = cast<CUDADeviceAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CUDADeviceBuiltinSurfaceType: {
const auto *SA = cast<CUDADeviceBuiltinSurfaceTypeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CUDADeviceBuiltinTextureType: {
const auto *SA = cast<CUDADeviceBuiltinTextureTypeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CUDAGlobal: {
const auto *SA = cast<CUDAGlobalAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CUDAHost: {
const auto *SA = cast<CUDAHostAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CUDAInvalidTarget: {
const auto *SA = cast<CUDAInvalidTargetAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CUDALaunchBounds: {
const auto *SA = cast<CUDALaunchBoundsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getMaxThreads());
Record.AddStmt(SA->getMinBlocks());
break;
}
case attr::CUDAShared: {
const auto *SA = cast<CUDASharedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CXX11NoReturn: {
const auto *SA = cast<CXX11NoReturnAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CallableWhen: {
const auto *SA = cast<CallableWhenAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->callableStates_size());
for (CallableWhenAttr::callableStates_iterator i = SA->callableStates_begin(), e = SA->callableStates_end(); i != e; ++i)
Record.push_back((*i));
break;
}
case attr::Callback: {
const auto *SA = cast<CallbackAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->encoding_size());
for (auto &Val : SA->encoding())
Record.push_back(Val);
break;
}
case attr::CalledOnce: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Capability: {
const auto *SA = cast<CapabilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::CapturedRecord: {
const auto *SA = cast<CapturedRecordAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CarriesDependency: {
const auto *SA = cast<CarriesDependencyAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Cleanup: {
const auto *SA = cast<CleanupAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddDeclRef(SA->getFunctionDecl());
break;
}
case attr::CmseNSCall: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CmseNSEntry: {
const auto *SA = cast<CmseNSEntryAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::CodeSeg: {
const auto *SA = cast<CodeSegAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::Cold: {
const auto *SA = cast<ColdAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Common: {
const auto *SA = cast<CommonAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Const: {
const auto *SA = cast<ConstAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ConstInit: {
const auto *SA = cast<ConstInitAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Constructor: {
const auto *SA = cast<ConstructorAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getPriority());
break;
}
case attr::Consumable: {
const auto *SA = cast<ConsumableAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getDefaultState());
break;
}
case attr::ConsumableAutoCast: {
const auto *SA = cast<ConsumableAutoCastAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ConsumableSetOnRead: {
const auto *SA = cast<ConsumableSetOnReadAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Convergent: {
const auto *SA = cast<ConvergentAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::DLLExport: {
const auto *SA = cast<DLLExportAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::DLLExportStaticLocal: {
const auto *SA = cast<DLLExportStaticLocalAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::DLLImport: {
const auto *SA = cast<DLLImportAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::DLLImportStaticLocal: {
const auto *SA = cast<DLLImportStaticLocalAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Deprecated: {
const auto *SA = cast<DeprecatedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getMessage());
Record.AddString(SA->getReplacement());
break;
}
case attr::Destructor: {
const auto *SA = cast<DestructorAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getPriority());
break;
}
case attr::DiagnoseAsBuiltin: {
const auto *SA = cast<DiagnoseAsBuiltinAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddDeclRef(SA->getFunction());
Record.push_back(SA->argIndices_size());
for (auto &Val : SA->argIndices())
Record.push_back(Val);
break;
}
case attr::DiagnoseIf: {
const auto *SA = cast<DiagnoseIfAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getCond());
Record.AddString(SA->getMessage());
Record.push_back(SA->getDiagnosticType());
Record.push_back(SA->getArgDependent());
Record.AddDeclRef(SA->getParent());
break;
}
case attr::DisableSanitizerInstrumentation: {
const auto *SA = cast<DisableSanitizerInstrumentationAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::DisableTailCalls: {
const auto *SA = cast<DisableTailCallsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::EmptyBases: {
const auto *SA = cast<EmptyBasesAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::EnableIf: {
const auto *SA = cast<EnableIfAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getCond());
Record.AddString(SA->getMessage());
break;
}
case attr::EnforceTCB: {
const auto *SA = cast<EnforceTCBAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getTCBName());
break;
}
case attr::EnforceTCBLeaf: {
const auto *SA = cast<EnforceTCBLeafAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getTCBName());
break;
}
case attr::EnumExtensibility: {
const auto *SA = cast<EnumExtensibilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getExtensibility());
break;
}
case attr::Error: {
const auto *SA = cast<ErrorAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getUserDiagnostic());
break;
}
case attr::ExcludeFromExplicitInstantiation: {
const auto *SA = cast<ExcludeFromExplicitInstantiationAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ExclusiveTrylockFunction: {
const auto *SA = cast<ExclusiveTrylockFunctionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getSuccessValue());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::ExternalSourceSymbol: {
const auto *SA = cast<ExternalSourceSymbolAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getLanguage());
Record.AddString(SA->getDefinedIn());
Record.push_back(SA->getGeneratedDeclaration());
break;
}
case attr::FallThrough: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::FastCall: {
const auto *SA = cast<FastCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Final: {
const auto *SA = cast<FinalAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::FlagEnum: {
const auto *SA = cast<FlagEnumAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Flatten: {
const auto *SA = cast<FlattenAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Format: {
const auto *SA = cast<FormatAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getType());
Record.push_back(SA->getFormatIdx());
Record.push_back(SA->getFirstArg());
break;
}
case attr::FormatArg: {
const auto *SA = cast<FormatArgAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getFormatIdx().serialize());
break;
}
case attr::GNUInline: {
const auto *SA = cast<GNUInlineAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::GuardedBy: {
const auto *SA = cast<GuardedByAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getArg());
break;
}
case attr::GuardedVar: {
const auto *SA = cast<GuardedVarAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::HIPManaged: {
const auto *SA = cast<HIPManagedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Hot: {
const auto *SA = cast<HotAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::IBAction: {
const auto *SA = cast<IBActionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::IBOutlet: {
const auto *SA = cast<IBOutletAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::IBOutletCollection: {
const auto *SA = cast<IBOutletCollectionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddTypeSourceInfo(SA->getInterfaceLoc());
break;
}
case attr::IFunc: {
const auto *SA = cast<IFuncAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getResolver());
break;
}
case attr::InitPriority: {
const auto *SA = cast<InitPriorityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getPriority());
break;
}
case attr::InitSeg: {
const auto *SA = cast<InitSegAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getSection());
break;
}
case attr::IntelOclBicc: {
const auto *SA = cast<IntelOclBiccAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::InternalLinkage: {
const auto *SA = cast<InternalLinkageAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::LTOVisibilityPublic: {
const auto *SA = cast<LTOVisibilityPublicAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::LayoutVersion: {
const auto *SA = cast<LayoutVersionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getVersion());
break;
}
case attr::Leaf: {
const auto *SA = cast<LeafAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::LifetimeBound: {
const auto *SA = cast<LifetimeBoundAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Likely: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::LoaderUninitialized: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::LockReturned: {
const auto *SA = cast<LockReturnedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getArg());
break;
}
case attr::LocksExcluded: {
const auto *SA = cast<LocksExcludedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::LoopHint: {
const auto *SA = cast<LoopHintAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getOption());
Record.push_back(SA->getState());
Record.AddStmt(SA->getValue());
break;
}
case attr::M68kInterrupt: {
const auto *SA = cast<M68kInterruptAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getNumber());
break;
}
case attr::MIGServerRoutine: {
const auto *SA = cast<MIGServerRoutineAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MSABI: {
const auto *SA = cast<MSABIAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MSAllocator: {
const auto *SA = cast<MSAllocatorAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MSInheritance: {
const auto *SA = cast<MSInheritanceAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getBestCase());
break;
}
case attr::MSNoVTable: {
const auto *SA = cast<MSNoVTableAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MSP430Interrupt: {
const auto *SA = cast<MSP430InterruptAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getNumber());
break;
}
case attr::MSStruct: {
const auto *SA = cast<MSStructAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MSVtorDisp: {
const auto *SA = cast<MSVtorDispAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getVdm());
break;
}
case attr::MaxFieldAlignment: {
const auto *SA = cast<MaxFieldAlignmentAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getAlignment());
break;
}
case attr::MayAlias: {
const auto *SA = cast<MayAliasAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MicroMips: {
const auto *SA = cast<MicroMipsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MinSize: {
const auto *SA = cast<MinSizeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MinVectorWidth: {
const auto *SA = cast<MinVectorWidthAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getVectorWidth());
break;
}
case attr::Mips16: {
const auto *SA = cast<Mips16Attr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MipsInterrupt: {
const auto *SA = cast<MipsInterruptAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getInterrupt());
break;
}
case attr::MipsLongCall: {
const auto *SA = cast<MipsLongCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::MipsShortCall: {
const auto *SA = cast<MipsShortCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Mode: {
const auto *SA = cast<ModeAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getMode());
break;
}
case attr::MustTail: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NSConsumed: {
const auto *SA = cast<NSConsumedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NSConsumesSelf: {
const auto *SA = cast<NSConsumesSelfAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NSErrorDomain: {
const auto *SA = cast<NSErrorDomainAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddDeclRef(SA->getErrorDomain());
break;
}
case attr::NSReturnsAutoreleased: {
const auto *SA = cast<NSReturnsAutoreleasedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NSReturnsNotRetained: {
const auto *SA = cast<NSReturnsNotRetainedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NSReturnsRetained: {
const auto *SA = cast<NSReturnsRetainedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Naked: {
const auto *SA = cast<NakedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoAlias: {
const auto *SA = cast<NoAliasAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoBuiltin: {
const auto *SA = cast<NoBuiltinAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->builtinNames_size());
for (auto &Val : SA->builtinNames())
Record.AddString(Val);
break;
}
case attr::NoCommon: {
const auto *SA = cast<NoCommonAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoDebug: {
const auto *SA = cast<NoDebugAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoDeref: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoDestroy: {
const auto *SA = cast<NoDestroyAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoDuplicate: {
const auto *SA = cast<NoDuplicateAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoEscape: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoInline: {
const auto *SA = cast<NoInlineAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoInstrumentFunction: {
const auto *SA = cast<NoInstrumentFunctionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoMerge: {
const auto *SA = cast<NoMergeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoMicroMips: {
const auto *SA = cast<NoMicroMipsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoMips16: {
const auto *SA = cast<NoMips16Attr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoProfileFunction: {
const auto *SA = cast<NoProfileFunctionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoReturn: {
const auto *SA = cast<NoReturnAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoSanitize: {
const auto *SA = cast<NoSanitizeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->sanitizers_size());
for (auto &Val : SA->sanitizers())
Record.AddString(Val);
break;
}
case attr::NoSpeculativeLoadHardening: {
const auto *SA = cast<NoSpeculativeLoadHardeningAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoSplitStack: {
const auto *SA = cast<NoSplitStackAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoStackProtector: {
const auto *SA = cast<NoStackProtectorAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoThreadSafetyAnalysis: {
const auto *SA = cast<NoThreadSafetyAnalysisAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoThrow: {
const auto *SA = cast<NoThrowAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NoUniqueAddress: {
const auto *SA = cast<NoUniqueAddressAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::NonNull: {
const auto *SA = cast<NonNullAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.push_back(Val.serialize());
break;
}
case attr::NotTailCalled: {
const auto *SA = cast<NotTailCalledAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OMPAllocateDecl: {
const auto *SA = cast<OMPAllocateDeclAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getAllocatorType());
Record.AddStmt(SA->getAllocator());
Record.AddStmt(SA->getAlignment());
break;
}
case attr::OMPCaptureKind: {
const auto *SA = cast<OMPCaptureKindAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getCaptureKindVal());
break;
}
case attr::OMPCaptureNoInit: {
const auto *SA = cast<OMPCaptureNoInitAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OMPDeclareSimdDecl: {
const auto *SA = cast<OMPDeclareSimdDeclAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getBranchState());
Record.AddStmt(SA->getSimdlen());
Record.push_back(SA->uniforms_size());
for (auto &Val : SA->uniforms())
Record.AddStmt(Val);
Record.push_back(SA->aligneds_size());
for (auto &Val : SA->aligneds())
Record.AddStmt(Val);
Record.push_back(SA->alignments_size());
for (auto &Val : SA->alignments())
Record.AddStmt(Val);
Record.push_back(SA->linears_size());
for (auto &Val : SA->linears())
Record.AddStmt(Val);
Record.push_back(SA->modifiers_size());
for (auto &Val : SA->modifiers())
Record.push_back(Val);
Record.push_back(SA->steps_size());
for (auto &Val : SA->steps())
Record.AddStmt(Val);
break;
}
case attr::OMPDeclareTargetDecl: {
const auto *SA = cast<OMPDeclareTargetDeclAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getMapType());
Record.push_back(SA->getDevType());
Record.push_back(SA->getLevel());
break;
}
case attr::OMPDeclareVariant: {
const auto *SA = cast<OMPDeclareVariantAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getVariantFuncRef());
Record.writeOMPTraitInfo(SA->getTraitInfos());
Record.push_back(SA->adjustArgsNothing_size());
for (auto &Val : SA->adjustArgsNothing())
Record.AddStmt(Val);
Record.push_back(SA->adjustArgsNeedDevicePtr_size());
for (auto &Val : SA->adjustArgsNeedDevicePtr())
Record.AddStmt(Val);
Record.push_back(SA->appendArgs_size());
for (OMPDeclareVariantAttr::appendArgs_iterator i = SA->appendArgs_begin(), e = SA->appendArgs_end(); i != e; ++i)
Record.push_back((*i));
break;
}
case attr::OMPReferencedVar: {
const auto *SA = cast<OMPReferencedVarAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getRef());
break;
}
case attr::OMPThreadPrivateDecl: {
const auto *SA = cast<OMPThreadPrivateDeclAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OSConsumed: {
const auto *SA = cast<OSConsumedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OSConsumesThis: {
const auto *SA = cast<OSConsumesThisAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OSReturnsNotRetained: {
const auto *SA = cast<OSReturnsNotRetainedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OSReturnsRetained: {
const auto *SA = cast<OSReturnsRetainedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OSReturnsRetainedOnNonZero: {
const auto *SA = cast<OSReturnsRetainedOnNonZeroAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OSReturnsRetainedOnZero: {
const auto *SA = cast<OSReturnsRetainedOnZeroAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCBoxable: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCBridge: {
const auto *SA = cast<ObjCBridgeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getBridgedType());
break;
}
case attr::ObjCBridgeMutable: {
const auto *SA = cast<ObjCBridgeMutableAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getBridgedType());
break;
}
case attr::ObjCBridgeRelated: {
const auto *SA = cast<ObjCBridgeRelatedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getRelatedClass());
Record.AddIdentifierRef(SA->getClassMethod());
Record.AddIdentifierRef(SA->getInstanceMethod());
break;
}
case attr::ObjCClassStub: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCDesignatedInitializer: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCDirect: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCDirectMembers: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCException: {
const auto *SA = cast<ObjCExceptionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCExplicitProtocolImpl: {
const auto *SA = cast<ObjCExplicitProtocolImplAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCExternallyRetained: {
const auto *SA = cast<ObjCExternallyRetainedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCGC: {
const auto *SA = cast<ObjCGCAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getKind());
break;
}
case attr::ObjCIndependentClass: {
const auto *SA = cast<ObjCIndependentClassAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCInertUnsafeUnretained: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCKindOf: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCMethodFamily: {
const auto *SA = cast<ObjCMethodFamilyAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getFamily());
break;
}
case attr::ObjCNSObject: {
const auto *SA = cast<ObjCNSObjectAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCNonLazyClass: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCNonRuntimeProtocol: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCOwnership: {
const auto *SA = cast<ObjCOwnershipAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getKind());
break;
}
case attr::ObjCPreciseLifetime: {
const auto *SA = cast<ObjCPreciseLifetimeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCRequiresPropertyDefs: {
const auto *SA = cast<ObjCRequiresPropertyDefsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCRequiresSuper: {
const auto *SA = cast<ObjCRequiresSuperAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCReturnsInnerPointer: {
const auto *SA = cast<ObjCReturnsInnerPointerAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCRootClass: {
const auto *SA = cast<ObjCRootClassAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCRuntimeName: {
const auto *SA = cast<ObjCRuntimeNameAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getMetadataName());
break;
}
case attr::ObjCRuntimeVisible: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ObjCSubclassingRestricted: {
const auto *SA = cast<ObjCSubclassingRestrictedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLAccess: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLConstantAddressSpace: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLGenericAddressSpace: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLGlobalAddressSpace: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLGlobalDeviceAddressSpace: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLGlobalHostAddressSpace: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLIntelReqdSubGroupSize: {
const auto *SA = cast<OpenCLIntelReqdSubGroupSizeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getSubGroupSize());
break;
}
case attr::OpenCLKernel: {
const auto *SA = cast<OpenCLKernelAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLLocalAddressSpace: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLPrivateAddressSpace: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::OpenCLUnrollHint: {
const auto *SA = cast<OpenCLUnrollHintAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getUnrollHint());
break;
}
case attr::OptimizeNone: {
const auto *SA = cast<OptimizeNoneAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Overloadable: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Override: {
const auto *SA = cast<OverrideAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Owner: {
const auto *SA = cast<OwnerAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddTypeSourceInfo(SA->getDerefTypeLoc());
break;
}
case attr::Ownership: {
const auto *SA = cast<OwnershipAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getModule());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.push_back(Val.serialize());
break;
}
case attr::Packed: {
const auto *SA = cast<PackedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ParamTypestate: {
const auto *SA = cast<ParamTypestateAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getParamState());
break;
}
case attr::Pascal: {
const auto *SA = cast<PascalAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::PassObjectSize: {
const auto *SA = cast<PassObjectSizeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getType());
break;
}
case attr::PatchableFunctionEntry: {
const auto *SA = cast<PatchableFunctionEntryAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getCount());
Record.push_back(SA->getOffset());
break;
}
case attr::Pcs: {
const auto *SA = cast<PcsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getPCS());
break;
}
case attr::Pointer: {
const auto *SA = cast<PointerAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddTypeSourceInfo(SA->getDerefTypeLoc());
break;
}
case attr::PragmaClangBSSSection: {
const auto *SA = cast<PragmaClangBSSSectionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::PragmaClangDataSection: {
const auto *SA = cast<PragmaClangDataSectionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::PragmaClangRelroSection: {
const auto *SA = cast<PragmaClangRelroSectionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::PragmaClangRodataSection: {
const auto *SA = cast<PragmaClangRodataSectionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::PragmaClangTextSection: {
const auto *SA = cast<PragmaClangTextSectionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::PreferredName: {
const auto *SA = cast<PreferredNameAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddTypeSourceInfo(SA->getTypedefTypeLoc());
break;
}
case attr::PreserveAll: {
const auto *SA = cast<PreserveAllAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::PreserveMost: {
const auto *SA = cast<PreserveMostAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::PtGuardedBy: {
const auto *SA = cast<PtGuardedByAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getArg());
break;
}
case attr::PtGuardedVar: {
const auto *SA = cast<PtGuardedVarAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Ptr32: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Ptr64: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Pure: {
const auto *SA = cast<PureAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::RISCVInterrupt: {
const auto *SA = cast<RISCVInterruptAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getInterrupt());
break;
}
case attr::RegCall: {
const auto *SA = cast<RegCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Reinitializes: {
const auto *SA = cast<ReinitializesAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ReleaseCapability: {
const auto *SA = cast<ReleaseCapabilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::ReleaseHandle: {
const auto *SA = cast<ReleaseHandleAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getHandleType());
break;
}
case attr::RenderScriptKernel: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ReqdWorkGroupSize: {
const auto *SA = cast<ReqdWorkGroupSizeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getXDim());
Record.push_back(SA->getYDim());
Record.push_back(SA->getZDim());
break;
}
case attr::RequiresCapability: {
const auto *SA = cast<RequiresCapabilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::Restrict: {
const auto *SA = cast<RestrictAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Retain: {
const auto *SA = cast<RetainAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ReturnTypestate: {
const auto *SA = cast<ReturnTypestateAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getState());
break;
}
case attr::ReturnsNonNull: {
const auto *SA = cast<ReturnsNonNullAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ReturnsTwice: {
const auto *SA = cast<ReturnsTwiceAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SPtr: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SYCLKernel: {
const auto *SA = cast<SYCLKernelAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::ScopedLockable: {
const auto *SA = cast<ScopedLockableAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Section: {
const auto *SA = cast<SectionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::SelectAny: {
const auto *SA = cast<SelectAnyAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Sentinel: {
const auto *SA = cast<SentinelAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getSentinel());
Record.push_back(SA->getNullPos());
break;
}
case attr::SetTypestate: {
const auto *SA = cast<SetTypestateAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getNewState());
break;
}
case attr::SharedTrylockFunction: {
const auto *SA = cast<SharedTrylockFunctionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getSuccessValue());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::SpeculativeLoadHardening: {
const auto *SA = cast<SpeculativeLoadHardeningAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::StandaloneDebug: {
const auto *SA = cast<StandaloneDebugAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::StdCall: {
const auto *SA = cast<StdCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::StrictFP: {
const auto *SA = cast<StrictFPAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Suppress: {
const auto *SA = cast<SuppressAttr>(A);
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->diagnosticIdentifiers_size());
for (auto &Val : SA->diagnosticIdentifiers())
Record.AddString(Val);
break;
}
case attr::SwiftAsync: {
const auto *SA = cast<SwiftAsyncAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getKind());
Record.push_back(SA->getCompletionHandlerIndex().serialize());
break;
}
case attr::SwiftAsyncCall: {
const auto *SA = cast<SwiftAsyncCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftAsyncContext: {
const auto *SA = cast<SwiftAsyncContextAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftAsyncError: {
const auto *SA = cast<SwiftAsyncErrorAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getConvention());
Record.push_back(SA->getHandlerParamIdx());
break;
}
case attr::SwiftAsyncName: {
const auto *SA = cast<SwiftAsyncNameAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::SwiftAttr: {
const auto *SA = cast<SwiftAttrAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getAttribute());
break;
}
case attr::SwiftBridge: {
const auto *SA = cast<SwiftBridgeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getSwiftType());
break;
}
case attr::SwiftBridgedTypedef: {
const auto *SA = cast<SwiftBridgedTypedefAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftCall: {
const auto *SA = cast<SwiftCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftContext: {
const auto *SA = cast<SwiftContextAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftError: {
const auto *SA = cast<SwiftErrorAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getConvention());
break;
}
case attr::SwiftErrorResult: {
const auto *SA = cast<SwiftErrorResultAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftIndirectResult: {
const auto *SA = cast<SwiftIndirectResultAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftName: {
const auto *SA = cast<SwiftNameAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getName());
break;
}
case attr::SwiftNewType: {
const auto *SA = cast<SwiftNewTypeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getNewtypeKind());
break;
}
case attr::SwiftObjCMembers: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SwiftPrivate: {
const auto *SA = cast<SwiftPrivateAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::SysVABI: {
const auto *SA = cast<SysVABIAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TLSModel: {
const auto *SA = cast<TLSModelAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getModel());
break;
}
case attr::Target: {
const auto *SA = cast<TargetAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getFeaturesStr());
break;
}
case attr::TargetClones: {
const auto *SA = cast<TargetClonesAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->featuresStrs_size());
for (auto &Val : SA->featuresStrs())
Record.AddString(Val);
break;
}
case attr::TestTypestate: {
const auto *SA = cast<TestTypestateAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getTestState());
break;
}
case attr::ThisCall: {
const auto *SA = cast<ThisCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Thread: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TransparentUnion: {
const auto *SA = cast<TransparentUnionAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TrivialABI: {
const auto *SA = cast<TrivialABIAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TryAcquireCapability: {
const auto *SA = cast<TryAcquireCapabilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddStmt(SA->getSuccessValue());
Record.push_back(SA->args_size());
for (auto &Val : SA->args())
Record.AddStmt(Val);
break;
}
case attr::TypeNonNull: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TypeNullUnspecified: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TypeNullable: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TypeNullableResult: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::TypeTagForDatatype: {
const auto *SA = cast<TypeTagForDatatypeAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddIdentifierRef(SA->getArgumentKind());
Record.AddTypeSourceInfo(SA->getMatchingCTypeLoc());
Record.push_back(SA->getLayoutCompatible());
Record.push_back(SA->getMustBeNull());
break;
}
case attr::TypeVisibility: {
const auto *SA = cast<TypeVisibilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getVisibility());
break;
}
case attr::UPtr: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Unavailable: {
const auto *SA = cast<UnavailableAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getMessage());
Record.push_back(SA->getImplicitReason());
break;
}
case attr::Uninitialized: {
const auto *SA = cast<UninitializedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Unlikely: {
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Unused: {
const auto *SA = cast<UnusedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::UseHandle: {
const auto *SA = cast<UseHandleAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getHandleType());
break;
}
case attr::Used: {
const auto *SA = cast<UsedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::UsingIfExists: {
const auto *SA = cast<UsingIfExistsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Uuid: {
const auto *SA = cast<UuidAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getGuid());
Record.AddDeclRef(SA->getGuidDecl());
break;
}
case attr::VecReturn: {
const auto *SA = cast<VecReturnAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::VecTypeHint: {
const auto *SA = cast<VecTypeHintAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddTypeSourceInfo(SA->getTypeHintLoc());
break;
}
case attr::VectorCall: {
const auto *SA = cast<VectorCallAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::Visibility: {
const auto *SA = cast<VisibilityAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getVisibility());
break;
}
case attr::WarnUnused: {
const auto *SA = cast<WarnUnusedAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::WarnUnusedResult: {
const auto *SA = cast<WarnUnusedResultAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getMessage());
break;
}
case attr::Weak: {
const auto *SA = cast<WeakAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::WeakImport: {
const auto *SA = cast<WeakImportAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::WeakRef: {
const auto *SA = cast<WeakRefAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getAliasee());
break;
}
case attr::WebAssemblyExportName: {
const auto *SA = cast<WebAssemblyExportNameAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getExportName());
break;
}
case attr::WebAssemblyImportModule: {
const auto *SA = cast<WebAssemblyImportModuleAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getImportModule());
break;
}
case attr::WebAssemblyImportName: {
const auto *SA = cast<WebAssemblyImportNameAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.AddString(SA->getImportName());
break;
}
case attr::WorkGroupSizeHint: {
const auto *SA = cast<WorkGroupSizeHintAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getXDim());
Record.push_back(SA->getYDim());
Record.push_back(SA->getZDim());
break;
}
case attr::X86ForceAlignArgPointer: {
const auto *SA = cast<X86ForceAlignArgPointerAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::XRayInstrument: {
const auto *SA = cast<XRayInstrumentAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
break;
}
case attr::XRayLogArgs: {
const auto *SA = cast<XRayLogArgsAttr>(A);
Record.push_back(SA->isInherited());
Record.push_back(A->isImplicit());
Record.push_back(A->isPackExpansion());
Record.push_back(SA->getArgumentCount());
break;
}
}
| [
"emma@labbe.me"
] | emma@labbe.me |
b65359d43d99d86eecc4cb2b7bd1ee1634b7db13 | fccfcd01d7d97e5d5114b3127928fc9b61231db6 | /Polynomial Derivatives.cpp | 530e4f2c9e247744acab6fb9f9ab16d902855490 | [] | no_license | selinahsu/derivative-of-a-polynomial | aa26d041d65ffb14aa00390a18b289e30259c0a2 | 64e9caf6ec0307e7020959da01ea0533bb39951e | refs/heads/master | 2020-08-01T12:47:08.553850 | 2019-09-26T04:45:31 | 2019-09-26T04:45:31 | 211,001,522 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 792 | cpp | #include <iostream>
#include <string>
#include <cmath>
#include <sstream>
using namespace std;
int main () {
string input = "";
cout << "Enter a term to derive with respect to x, with no spaces or brackets: " << endl;
cin >> input;
int length = input.size();
// separate coefficient
string coeffStr = input.substr(0, input.find("^")); // turn coefficient to string
int digits = coeffStr.size();
stringstream coeffToInt(coeffStr);
int coeff = 0;
coeffToInt >> coeff;
// separate exponent
string expStr = input.substr(length-1, length-1);
stringstream expToInt(expStr);
int exp = 0;
expToInt >> exp;
coeff = coeff*exp;
exp--;
cout << coeff << "^" << exp << endl;
system("PAUSE");
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
ba3d5f3017d708ca207d893e6031ed19dbc192ea | ca61f8b3f724c30f2caa523cc4f436246dcc4beb | /kruskals.cpp | f99b791ac2caf85c704f06434d294e3b3c30763c | [] | no_license | sumit1921/ALGORITHM | 14a2e8be003fdff8a6ef8505cec0b08d772409b7 | 2a3651775ec9fe54837b2735d585a1f8ff78dc62 | refs/heads/main | 2023-04-12T13:14:20.177185 | 2021-05-02T04:15:18 | 2021-05-02T04:15:18 | 342,469,086 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,591 | cpp | #include <iostream>
#include <algorithm>
using namespace std;
class Edge{
public :
int source;
int destination;
int weight;
};
bool compare(Edge e1,Edge e2)
{
return e1.weight<e2.weight;
}
int findParent(int i,int *parent)
{
if(parent[i]==i)
{
return i;
}
else
return findParent(parent[i],parent);
}
void kruskals(Edge *input,int e,int n)
{
sort(input,input+e,compare);
int *parent=new int[n];
Edge *output=new Edge[n-1];
for(int i=0;i<n;i++)
{
parent[i]=i;
}
int count=0;
int i=0;
while(count!=n-1)
{
Edge currentedge=input[i];
int sourceParent=findParent(currentedge.source,parent);
int destParent=findParent(currentedge.destination,parent);
if(sourceParent!=destParent)
{
output[count]=currentedge;
count++;
parent[sourceParent]=destParent;
}
i++;
}
cout<<endl<<endl;
cout<<"Displaying the output of kruskal's algorithm "<<endl<<endl;
for(int i=0;i<n-1;i++)
{
cout<<output[i].source<<" "<<output[i].destination<<" "<<output[i].weight<<endl;
}
}
int main()
{ int e,n;
cout<<"Enter the number of vertices"<<endl;
cin>>n;
cout<<"Enter number of edges"<<endl;
cin>>e;
Edge *input = new Edge[e];
cout<<"Enter source: destination: weight"<<endl;
for(int i=0;i<e;i++)
{ int s,d,w;
cin>>s>>d>>w;
input[i].source=s;
input[i].destination=d;
input[i].weight=w;
}
kruskals(input,e,n);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
01566f40fb71d44470392f2ff0fa6664c092cdb8 | 82685d006a3c55bb7ee00028d222a5b590189bbf | /Sourcecode/mx/core/elements/OtherAppearance.cpp | e8b842753f426bc852eaebf602ec5d28f023d284 | [
"MIT"
] | permissive | ailialy/MusicXML-Class-Library | 41b1b6b28a67fd7cdfbbc4fb7c5c936aee4d9eca | 5e1f1cc8831449476f3facfff5cf852d66488d6a | refs/heads/master | 2020-06-18T23:46:50.306435 | 2016-08-22T04:33:44 | 2016-08-22T04:33:44 | 74,932,821 | 2 | 0 | null | 2016-11-28T03:14:23 | 2016-11-28T03:14:23 | null | UTF-8 | C++ | false | false | 2,293 | cpp | // MusicXML Class Library v0.2
// Copyright (c) 2015 - 2016 by Matthew James Briggs
#include "mx/core/elements/OtherAppearance.h"
#include "mx/core/FromXElement.h"
#include <iostream>
namespace mx
{
namespace core
{
OtherAppearance::OtherAppearance()
:myValue()
,myAttributes( std::make_shared<OtherAppearanceAttributes>() )
{}
OtherAppearance::OtherAppearance( const XsString& value )
:myValue( value )
,myAttributes( std::make_shared<OtherAppearanceAttributes>() )
{}
bool OtherAppearance::hasAttributes() const
{
return myAttributes->hasValues();
}
bool OtherAppearance::hasContents() const
{
return true;
}
std::ostream& OtherAppearance::streamAttributes( std::ostream& os ) const
{
if ( myAttributes )
{
myAttributes->toStream( os );
}
return os;
}
std::ostream& OtherAppearance::streamName( std::ostream& os ) const
{
os << "other-appearance";
return os;
}
std::ostream& OtherAppearance::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const
{
MX_UNUSED( indentLevel );
isOneLineOnly = true;
os << myValue;
return os;
}
OtherAppearanceAttributesPtr OtherAppearance::getAttributes() const
{
return myAttributes;
}
void OtherAppearance::setAttributes( const OtherAppearanceAttributesPtr& value )
{
if ( value )
{
myAttributes = value;
}
}
XsString OtherAppearance::getValue() const
{
return myValue;
}
void OtherAppearance::setValue( const XsString& value )
{
myValue = value;
}
bool OtherAppearance::fromXElement( std::ostream& message, xml::XElement& xelement )
{
bool isSuccess = true;
isSuccess &= myAttributes->fromXElement( message, xelement );
myValue.setValue( xelement.getValue() );
MX_RETURN_IS_SUCCESS;
}
}
}
| [
"matthew.james.briggs@gmail.com"
] | matthew.james.briggs@gmail.com |
d45ba27a0b9d11a4c33d12bacee859a10cd23617 | e952a5f1728e936b517f10e2c56b346beac21bfc | /src/qt/test/test_main.cpp | 6f1219c516f97ce61d3198f9c90b9af4268b48a3 | [] | no_license | wtomtom/projetoh | 560fbb47d66020b8bf2467f0e63e2e975c44fb0a | 80582c90940d7f7f66900d2a298930fc239e400f | refs/heads/master | 2021-04-12T07:56:25.828343 | 2018-03-19T23:43:58 | 2018-03-19T23:43:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,235 | cpp | // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The vizeh developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/vizeh-config.h"
#endif
#include "util.h"
#include "uritests.h"
#ifdef ENABLE_WALLET
#include "paymentservertests.h"
#endif
#include <QCoreApplication>
#include <QObject>
#include <QTest>
#if defined(QT_STATICPLUGIN) && QT_VERSION < 0x050000
#include <QtPlugin>
Q_IMPORT_PLUGIN(qcncodecs)
Q_IMPORT_PLUGIN(qjpcodecs)
Q_IMPORT_PLUGIN(qtwcodecs)
Q_IMPORT_PLUGIN(qkrcodecs)
#endif
// This is all you need to run all the tests
int main(int argc, char *argv[])
{
SetupEnvironment();
bool fInvalid = false;
// Don't remove this, it's needed to access
// QCoreApplication:: in the tests
QCoreApplication app(argc, argv);
app.setApplicationName("vizeh-Qt-test");
URITests test1;
if (QTest::qExec(&test1) != 0)
fInvalid = true;
#ifdef ENABLE_WALLET
PaymentServerTests test2;
if (QTest::qExec(&test2) != 0)
fInvalid = true;
#endif
return fInvalid;
}
| [
"31394318+wtomtom@users.noreply.github.com"
] | 31394318+wtomtom@users.noreply.github.com |
e1d7e2d9838e0139943bc245ddd8a35db23aa7be | 8819fa21a7c1a157b9166e05f5c1c46df64c36fd | /TCP Server.cpp | b6a1c2b622e16a4ff90b0b362f98d11ef840fcfa | [] | no_license | levietkhoa98/BTLTM | 892763da3aefb629d0af9f5c32021777c12282dd | e66af6665c6998210324c85ecabd5992deeb2591 | refs/heads/master | 2020-04-24T23:55:29.209215 | 2019-03-24T16:31:35 | 2019-03-24T16:31:35 | 172,360,946 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,009 | cpp | #include <iostream>
#include "winsock2.h"
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
WSADATA wsa;
WSAStartup(MAKEWORD(2,2),&wsa);
SOCKET listener = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
SOCKADDR_IN addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons(8080);
bind(listener, (SOCKADDR *)&addr, sizeof(addr));
listen(listener, 5);
SOCKET client = accept(listener, NULL, NULL);
if (client) {
char buf[256];
FILE *fp1 = fopen("chao.txt","rb");
fgets(buf, 256, (FILE *)fp1);
// printf("%s\n", buf);
send(client, buf, sizeof(buf), 0);
fclose(fp1);
}
char buff[256];
int ret;
while (1) {
ret=recv(client,buff,sizeof(buff),0);
if(ret<=0) break;
buff[ret]=0;
FILE *fp2 = fopen("client.txt","w+");
fputs(buff,fp2);
}
closesocket(client);
closesocket(listener);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
deced15b75a3ab86de210babb88a5af1cd0fe679 | 06cf22cea213866474f7825ccd1798790233df99 | /solution.cpp | 56351d5fe73213223c7e7220831ecb60af78a63a | [] | no_license | Aditya-1295/hashcodepractice | 42a34f1076bd8272a0a2453931dffc3b3a8fb02b | 0f439f9e22be3c19229f5b4c9f25fbdbdead3959 | refs/heads/master | 2023-02-26T20:07:23.864645 | 2021-02-09T16:44:00 | 2021-02-09T16:44:00 | 337,383,197 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,640 | cpp | // Teams of 2, 3, or 4 people all ordered pizzas
// did not specify what i ngredients to put on the pizzas
// exactly one pizza should be available per person
// The goal is to maximize, per team, the number of
// different ingredients used in all their pizzas.
#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <set>
#include <sstream>
using namespace std;
class Pizza{
public:
int index;
set<string> ingredients;
};
int main()
{
int M;
int t1,t2,t3;
ifstream fin;
fin.open("a_example.txt");
int count = -1;
string line;
int input[4];
while(getline(fin, line)) {
istringstream is(line);
if (count == -1){
int num;
for (int i =0;i<4;i++){
is>>num;
input[i] = num;
}
M = input[0];
t1 = input[1];
t2 = input[2];
t3 = input[3];
}else{
int v;
string ingri;
while(true){
is>>v;
cout<<"Pizza index: "<<count<<" No. of ingre: "<<v<<endl;
for (int i =0;i<v;i++){
is>>ingri;
cout<<ingri<<" "; // ingri is the ingridents for the pizza index count;
}
cout<<endl;
if (is.eof()){
break;
}
}
}
count++;
}
fin.close();
cout<<M<<t1<<t2<<t3;
}
| [
"adityaguptamessi@gmail.com"
] | adityaguptamessi@gmail.com |
dc3818aa1a690e78ff5efda2a0e72085cccd00d1 | bce3dfcb2ab801087b663c56f590a8affa7495d0 | /src/consensus/merkle.cpp | 80ea9bb14fa15680ee0b822a0eec1fa2424857f2 | [
"MIT"
] | permissive | botslim/botslim_03.githab.io | cc9c61a1b51cc3ab7bd359ca9b95922ada6b033d | 3bd14fb80553e20aaa7a76ef2d8e84658e69fabb | refs/heads/master | 2021-04-18T22:38:39.456638 | 2018-02-24T15:54:16 | 2018-02-24T15:54:16 | 126,571,147 | 2 | 0 | MIT | 2018-03-24T06:08:18 | 2018-03-24T06:06:18 | C++ | UTF-8 | C++ | false | false | 7,167 | cpp | #include "merkle.h"
#include "hash.h"
#include "utilstrencodings.h"
/* WARNING! If you're reading this because you're learning about crypto
and/or designing a new system that will use merkle trees, keep in mind
that the following merkle tree algorithm has a serious flaw related to
duplicate txids, resulting in a vulnerability (CVE-2012-2459).
The reason is that if the number of hashes in the list at a given time
is odd, the last one is duplicated before computing the next level (which
is unusual in Merkle trees). This results in certain sequences of
transactions leading to the same merkle root. For example, these two
trees:
A A
/ \ / \
B C B C
/ \ | / \ / \
D E F D E F F
/ \ / \ / \ / \ / \ / \ / \
1 2 3 4 5 6 1 2 3 4 5 6 5 6
for transaction lists [1,2,3,4,5,6] and [1,2,3,4,5,6,5,6] (where 5 and
6 are repeated) result in the same root hash A (because the hash of both
of (F) and (F,F) is C).
The vulnerability results from being able to send a block with such a
transaction list, with the same merkle root, and the same block hash as
the original without duplication, resulting in failed validation. If the
receiving node proceeds to mark that block as permanently invalid
however, it will fail to accept further unmodified (and thus potentially
valid) versions of the same block. We defend against this by detecting
the case where we would hash two identical hashes at the end of the list
together, and treating that identically to the block having an invalid
merkle root. Assuming no double-SHA256 collisions, this will detect all
known ways of changing the transactions without affecting the merkle
root.
*/
/* This implements a constant-space merkle root/path calculator, limited to 2^32 leaves. */
static void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot, bool* pmutated, uint32_t branchpos, std::vector<uint256>* pbranch) {
if (pbranch) pbranch->clear();
if (leaves.size() == 0) {
if (pmutated) *pmutated = false;
if (proot) *proot = uint256();
return;
}
bool mutated = false;
// count is the number of leaves processed so far.
uint32_t count = 0;
// inner is an array of eagerly computed subtree hashes, indexed by tree
// level (0 being the leaves).
// For example, when count is 25 (11001 in binary), inner[4] is the hash of
// the first 16 leaves, inner[3] of the next 8 leaves, and inner[0] equal to
// the last leaf. The other inner entries are undefined.
uint256 inner[32];
// Which position in inner is a hash that depends on the matching leaf.
int matchlevel = -1;
// First process all leaves into 'inner' values.
while (count < leaves.size()) {
uint256 h = leaves[count];
bool matchh = count == branchpos;
count++;
int level;
// For each of the lower bits in count that are 0, do 1 step. Each
// corresponds to an inner value that existed before processing the
// current leaf, and each needs a hash to combine it.
for (level = 0; !(count & (((uint32_t)1) << level)); level++) {
if (pbranch) {
if (matchh) {
pbranch->push_back(inner[level]);
} else if (matchlevel == level) {
pbranch->push_back(h);
matchh = true;
}
}
mutated |= (inner[level] == h);
CHash256().Write(inner[level].begin(), 32).Write(h.begin(), 32).Finalize(h.begin());
}
// Store the resulting hash at inner position level.
inner[level] = h;
if (matchh) {
matchlevel = level;
}
}
// Do a final 'sweep' over the rightmost branch of the tree to process
// odd levels, and reduce everything to a single top value.
// Level is the level (counted from the bottom) up to which we've sweeped.
int level = 0;
// As long as bit number level in count is zero, skip it. It means there
// is nothing left at this level.
while (!(count & (((uint32_t)1) << level))) {
level++;
}
uint256 h = inner[level];
bool matchh = matchlevel == level;
while (count != (((uint32_t)1) << level)) {
// If we reach this point, h is an inner value that is not the top.
// We combine it with itself (Rapture's special rule for odd levels in
// the tree) to produce a higher level one.
if (pbranch && matchh) {
pbranch->push_back(h);
}
CHash256().Write(h.begin(), 32).Write(h.begin(), 32).Finalize(h.begin());
// Increment count to the value it would have if two entries at this
// level had existed.
count += (((uint32_t)1) << level);
level++;
// And propagate the result upwards accordingly.
while (!(count & (((uint32_t)1) << level))) {
if (pbranch) {
if (matchh) {
pbranch->push_back(inner[level]);
} else if (matchlevel == level) {
pbranch->push_back(h);
matchh = true;
}
}
CHash256().Write(inner[level].begin(), 32).Write(h.begin(), 32).Finalize(h.begin());
level++;
}
}
// Return result.
if (pmutated) *pmutated = mutated;
if (proot) *proot = h;
}
uint256 ComputeMerkleRoot(const std::vector<uint256>& leaves, bool* mutated) {
uint256 hash;
MerkleComputation(leaves, &hash, mutated, -1, NULL);
return hash;
}
std::vector<uint256> ComputeMerkleBranch(const std::vector<uint256>& leaves, uint32_t position) {
std::vector<uint256> ret;
MerkleComputation(leaves, NULL, NULL, position, &ret);
return ret;
}
uint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vector<uint256>& vMerkleBranch, uint32_t nIndex) {
uint256 hash = leaf;
for (std::vector<uint256>::const_iterator it = vMerkleBranch.begin(); it != vMerkleBranch.end(); ++it) {
if (nIndex & 1) {
hash = Hash(BEGIN(*it), END(*it), BEGIN(hash), END(hash));
} else {
hash = Hash(BEGIN(hash), END(hash), BEGIN(*it), END(*it));
}
nIndex >>= 1;
}
return hash;
}
uint256 BlockMerkleRoot(const CBlock& block, bool* mutated)
{
std::vector<uint256> leaves;
leaves.resize(block.vtx.size());
for (size_t s = 0; s < block.vtx.size(); s++) {
leaves[s] = block.vtx[s].GetHash();
}
return ComputeMerkleRoot(leaves, mutated);
}
std::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position)
{
std::vector<uint256> leaves;
leaves.resize(block.vtx.size());
for (size_t s = 0; s < block.vtx.size(); s++) {
leaves[s] = block.vtx[s].GetHash();
}
return ComputeMerkleBranch(leaves, position);
}
| [
"rapturecoredev@gmail.com"
] | rapturecoredev@gmail.com |
590980138077f8d0e0d232718170626786972cfb | 0976b156a14540f06eb631fda0fc8e5d96c9d520 | /TestConsole/TestConsole.cpp | 433cdc79588efa99c3edddfa9f6dfb698187932f | [] | no_license | foxesknow/Echo | 67fe82710767173126d47e3477df26f7966fd02c | 9321f411f383a46afa3a3b4630aafaf71de5005b | refs/heads/master | 2021-01-21T12:26:23.659940 | 2017-06-11T19:08:59 | 2017-06-11T19:08:59 | 14,444,184 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 709 | cpp | // TestConsole.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Echo\ThreadPool.h>
#include <Echo\Events.h>
#include <Echo\tstring.h>
#include <atomic>
int main()
{
using namespace Echo;
const char *greeting = "Hello, world!";
auto converted = tstd::to_wstring(greeting);
std::atomic<int> counter(0);
ManualResetEvent event(InitialState::NonSignalled);
{
ThreadPool pool;
pool.MinimumThreads(1);
pool.MaximumThreads(1);
pool.Start();
for(int i = 0; i < 1000; i++)
{
pool.Submit([&]
{
counter.fetch_add(1);
if(counter == 1000) event.Set();
});
}
pool.CancelOutstanding(false);
}
event.Wait();
return 0;
}
| [
"seanbatten58@gmail.com"
] | seanbatten58@gmail.com |
56d560e1a7b23ba4a72b51f7dcf2cc56bc8a4fb1 | d8735eadccc83f9949d9d28e3887cddde54aef88 | /A19H3.cpp | 3a9ba22edbf0472aadc53b2a21ec985df51664e6 | [] | no_license | borikar-abhishek/Applications | 936f3d98f153f44cd37804c5c3069ca0114527b7 | 429dfc01b960b7bcd43d0cbc797dacc8bd32e796 | refs/heads/main | 2023-06-23T18:11:41.934550 | 2021-07-25T14:28:41 | 2021-07-25T14:28:41 | 379,634,337 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,126 | cpp | //Accept N number from user and accept another number as NO from user and return index of last occureance of that number.
//Input : N : 6
// NO : 66
// Elements are : 85 66 11 66 11 88
//Output : 3
#include<iostream>
using namespace std;
class Number
{
public :
int *Arr;
int iSize;
int iNum;
Number(int iNo1,int iNo2)
{
iSize = iNo1;
iNum = iNo2;
Arr = new int[iSize];
}
void Accept()
{
int i = 0;
cout<<"Enter the values:\n";
for(i=0;i<iSize;i++)
{
cin>>Arr[i];
}
}
int Display()
{
int i = 0;
for(i = iSize;i>=0;i--)
{
if(((Arr[i]%iNum)==0))
{
break;
}
}
if(i==iSize)
{
return -1;
}
else
{
return i;
}
}
~Number()
{
delete []Arr;
}
};
int main()
{
int iNo1 = 0, iNo2 = 0;
int iRet;
cout<<"Enter number of elements : ";
cin>>iNo1;
cout<<"Enter the number : ";
cin>>iNo2;
Number obj(iNo1,iNo2);
obj.Accept();
iRet = obj.Display();
if(iRet == -1)
{
cout<<"There is no such element";
}
else
{
cout<<"Last occurence of "<<iNo2<<" is at "<<iRet;
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
a50a0f5fa1c38fa51a88305460d88bf9c70212d4 | e8a2fc44272c98ab58f55dfc901994402b2bab2e | /source/Board.cpp | b5f1b5934010e524d0da09391c2fd46e6429ff1c | [
"MIT"
] | permissive | LazyShpee/gomoku-3ds | 553857bed18147187be2bc68d10542ca7605255a | e34bb901e6cab02bcaa7ead937ac1ccdd55614d4 | refs/heads/master | 2021-01-20T08:01:20.431374 | 2017-06-27T13:06:01 | 2017-06-27T13:06:01 | 75,754,130 | 1 | 1 | null | 2017-06-27T12:37:34 | 2016-12-06T17:19:37 | C++ | UTF-8 | C++ | false | false | 3,301 | cpp | #include "../include/Board.hpp"
static int directions[8][2] = {
{-1, -1},
{0, -1},
{1, -1},
{1, 0},
{1, 1},
{0, 1},
{-1, 1},
{-1, 0}
};
Board::t_tile **Board::makeNewBoard(int w, int h) {
t_tile **board;
board = (t_tile **)malloc(sizeof(t_tile *) * w);
for (int x = 0; x < w; x++) {
board[x] = (t_tile *)malloc(sizeof(t_tile) * h);
for (int y = 0; y < h; y++) {
t_tile *cur = &board[x][y];
cur->x = x;
cur->y = y;
cur->p = 0;
cur->sides = (t_tile **)malloc(sizeof(t_tile *) * 8);
cur->dist = (int *)malloc(sizeof(int) * 8);
for (int s = 0; s < 8; s++) {
int _x = 18, _y = 18;
if (directions[s][0] < 0) _x = x;
else if (directions[s][0] > 0) _x = w - x - 1;
if (directions[s][1] < 0) _y = y;
else if (directions[s][1] > 0) _y = h - y - 1;
cur->dist[s] = _x > _y ? _y : _x;
cur->sides[s] = NULL;
}
}
}
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
for (int s = 0; s < 8; s++) {
t_tile *cur = &board[x][y];
int dx = directions[s][0], dy = directions[s][1];
if (((dx < 0 && x > 0) || (dx > 0 && x < w - 1) || !dx) &&
((dy < 0 && y > 0) || (dy > 0 && y < h - 1) || !dy))
cur->sides[s] = &board[x + dx][y + dy];
}
return board;
}
Board::t_tile **Board::makeNewBoard(char **board, int w, int h) {
t_tile **newBoard = makeNewBoard(w, h);
restoreBoard(newBoard, board, w, h);
return newBoard;
}
Board::t_tile **Board::makeNewBoard(Board::t_tile **board, int w, int h) {
t_tile **newBoard = makeNewBoard(w, h);
restoreBoard(newBoard, board, w, h);
return newBoard;
}
void Board::destroyBoard(Board::t_tile **board, int w, int h) {
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
free(board[x][y].sides);
free(board[x][y].dist);
}
free(board[x]);
}
free(board);
}
void Board::destroyBoard(char **board, int w, int h) {
for (int x = 0; x < w; x++) {
free(board[x]);
}
free(board);
}
void Board::restoreBoard(Board::t_tile **board, char **save, int w, int h) {
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
board[x][y].p = save[x][y];
}
}
}
void Board::restoreBoard(Board::t_tile **board, Board::t_tile **save, int w, int h) {
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
board[x][y].p = save[x][y].p;
}
}
}
void Board::saveBoard(Board::t_tile **board, char **save, int w, int h) {
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
save[x][y] = board[x][y].p;
}
}
}
char ** Board::saveBoard(Board::t_tile **board, int w, int h) {
char **save = (char **)malloc(sizeof(char *) * w);
for (int x = 0; x < w; x++) {
save[x] = (char *)malloc(sizeof(char) * h);
for (int y = 0; y < h; y++) {
save[x][y] = board[x][y].p;
}
}
return save;
} | [
"comemureravaud@gmail.com"
] | comemureravaud@gmail.com |
018e20334df97cf2bf3e4da790a2194cc7e64b0f | 0408d086a3fd502113588a61b36755fe23f55b10 | /code/1092 배.cpp | 9d6df69ed4bf899facd5f3e5d8eb2757ad7e1447 | [] | no_license | dwax1324/baekjoon | 6dfcf62f2b1643480b16777c37f4e5d711b932d9 | 3a6daf8a66dbb304af8a4002989c081dcffc831d | refs/heads/main | 2023-04-03T03:56:50.410972 | 2021-03-29T11:51:30 | 2021-03-29T11:51:30 | 310,809,466 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,523 | cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pic pair<int, char>
#define pipii pair<int, pii>
#define pll pair<long, long>
#define ror(begin, end, i) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define debug freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define is ==
#define isnot !=
#define pb push_back
#define F first
#define S second
#define error(args...) \
{ \
string _s = #args; \
replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); \
istream_iterator<string> _it(_ss); \
err(_it, args); \
cout << '\n'; \
}
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
cout << *it << " = " << a << ' ';
err(++it, args...);
}
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
그리디
둘 다 역순정렬후
크레인에서 3개씩 빼낸다.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
void preprocess() {
}
void solve() {
int n;
cin >> n;
vector<int> v1, v2;
ror(0, n, i) {
int a;
cin >> a;
v1.push_back(a);
}
int b;
cin >> b;
ror(0, b, i) {
int a;
cin >> a;
v2.push_back(a);
}
sort(rall(v1));
sort(rall(v2));
if (v2[0] > v1[0]) {
cout << -1;
exit(0);
}
int cnt = 0;
while (sz(v2)) {
cnt++;
ror(0, n, i) {
for (auto it = v2.begin(); it isnot v2.end();) {
if (*it <= v1[i]) {
v2.erase(it);
break;
} else {
++it;
}
}
}
}
cout << cnt;
}
int main() {
fastio;
preprocess();
debug; // ✨✨✨✨✨✨✨✨✨✨✨✨✨✨
int t = 1;
// cin >> t; // ✨✨✨✨✨✨✨✨✨✨✨✨✨✨
ror(0, t, i) {
// cout << "case #" << t << ": ";
solve();
}
} | [
"dwax1324@gmail.com"
] | dwax1324@gmail.com |
c101536c59bb791baff2c6be8fe93797814030a9 | ce1e8b29ffd9d97ffc5c693fe3bd4ee358b5e1d5 | /src/Voxie/Gui/VolumeNodeView.cpp | c9d55dc9523a50b021ac66e03d867c4c355a9d37 | [
"MIT"
] | permissive | voxie-viewer/voxie | d76fe7d3990b14dea34e654378d82ddeb48f6445 | 2b4f23116ab1c2fd44b134c4265a59987049dcdb | refs/heads/master | 2023-04-14T13:30:18.668070 | 2023-04-04T10:58:24 | 2023-04-04T10:58:24 | 60,341,017 | 6 | 1 | MIT | 2022-11-29T06:52:16 | 2016-06-03T10:50:54 | C++ | UTF-8 | C++ | false | false | 6,200 | cpp | /*
* Copyright (c) 2014-2022 The Voxie Authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// QDBusConnection should be included as early as possible:
// https://bugreports.qt.io/browse/QTBUG-48351 /
// https://bugreports.qt.io/browse/QTBUG-48377
#include <QtDBus/QDBusConnection>
#include "VolumeNodeView.hpp"
#include <Voxie/Data/Slice.hpp>
#include <Voxie/IVoxie.hpp>
#include <Voxie/Component/Plugin.hpp>
#include <QtWidgets/QAction>
#include <QtWidgets/QLabel>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QMenu>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QVBoxLayout>
using namespace vx::gui;
using namespace vx;
using namespace vx::plugin;
using namespace vx::io;
using namespace vx::filter;
VolumeNodeView::VolumeNodeView(vx::VolumeNode* dataSet, QWidget* parent)
: QWidget(parent), sequenceNumber(0), dataSet(dataSet) {
this->setMaximumHeight(400);
splitLayout = new QVBoxLayout();
form = new QFormLayout();
auto filename = dataSet->getFileInfo().fileName();
this->filenameLabel = new QLineEdit(filename);
// this->filenameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse |
// Qt::TextSelectableByKeyboard);
this->filenameLabel->setReadOnly(true);
form->addRow("Filename", this->filenameLabel);
QObject::connect(dataSet, &DataNode::fileInfoChanged, this,
[this](const QFileInfo& fileInfo) {
this->filenameLabel->setText(fileInfo.filePath());
});
tagLabel = new QLabel();
form->addRow("Tags", tagLabel);
splitLayout->addLayout(form);
this->setLayout(splitLayout);
this->setWindowTitle(this->dataSet->displayName());
this->update();
connect(this->dataSet, &Node::displayNameChanged, this,
&VolumeNodeView::setWindowTitle);
connect(this->dataSet, &VolumeNode::changed, this, &VolumeNodeView::update);
QMetaObject::Connection conni =
connect(this->dataSet, &QObject::destroyed, [this]() -> void {
this->dataSet = nullptr;
this->deleteLater();
});
connect(this, &QObject::destroyed,
[=]() -> void { this->disconnect(conni); });
}
void VolumeNodeView::setValues(
const QList<std::tuple<QString, QString>>& data) {
bool change = false;
if (labels.size() != data.size()) {
change = true;
} else {
for (int i = 0; i < labels.size(); i++) {
if (std::get<0>(labels[i]) != std::get<0>(data[i])) {
change = true;
break;
}
}
}
if (change) {
this->filenameLabel->setParent(nullptr);
this->tagLabel->setParent(nullptr);
// https://doc.qt.io/qt-5/qlayout.html#takeAt
QLayoutItem* child;
// Add check for form->count() to avoid
// "QFormLayout::takeAt: Invalid index 0" warning
while (form->count() && (child = form->takeAt(0)) != nullptr) {
delete child->widget(); // delete the widget
delete child; // delete the layout item
}
labels.clear();
form->addRow("Filename", this->filenameLabel);
for (int i = 0; i < data.size(); i++) {
auto name = std::get<0>(data[i]);
auto label = new QLabel();
label->setTextInteractionFlags(Qt::TextSelectableByMouse |
Qt::TextSelectableByKeyboard);
form->addRow(name, label);
labels.push_back(std::make_tuple(name, label));
}
form->addRow("Tags", this->tagLabel);
}
for (int i = 0; i < data.size(); i++) {
auto label = std::get<1>(labels[i]);
auto value = std::get<1>(data[i]);
label->setText(value);
}
}
void VolumeNodeView::update() {
// int precision = 6; // Takes too much space
int precision = 5;
QList<std::tuple<QString, QString>> fields;
auto data = this->dataSet ? this->dataSet->volumeData()
: QSharedPointer<vx::VolumeData>();
if (!data) {
fields << std::make_tuple("Size", "");
fields << std::make_tuple("Origin", "");
} else {
fields << std::make_tuple(
"Size", QString::number(data->volumeSize().x()) + " x " +
QString::number(data->volumeSize().y()) + " x " +
QString::number(data->volumeSize().z()));
fields << std::make_tuple(
"Origin", QString::number(data->origin().x(), 'g', precision) + " x " +
QString::number(data->origin().y(), 'g', precision) +
" x " +
QString::number(data->origin().z(), 'g', precision));
data->getVolumeInfo(fields);
}
auto dataObj = dynamic_cast<DataNode*>(dataSet);
QList<QSharedPointer<NodeTag>> tagList;
if (dataObj) tagList = dataObj->getTags();
QString tooltip = "";
for (QSharedPointer<NodeTag> tag : tagList) {
tooltip.append("Name: " + tag->getName() + "\n");
tooltip.append("Description: " + tag->getDescription() + "\n\n");
}
tooltip.chop(2);
this->tagLabel->setText(vx::NodeTag::joinDisplayNames(tagList, ", "));
this->tagLabel->setToolTip(tooltip);
setValues(fields);
}
VolumeNodeView::~VolumeNodeView() {
if (this->dataSet != nullptr) this->dataSet->deleteLater();
}
| [
"steffen.kiess@cis.iti.uni-stuttgart.de"
] | steffen.kiess@cis.iti.uni-stuttgart.de |
060a186f7d04efaa7df3d43176653def2ba5fcf7 | bbb8d941d0aa439ca435e0f00ddbd7330ad2db79 | /Practise/subString.cpp | 9bbc119b0b215431b91f9b598b3066c7474c548f | [] | no_license | dimritium/Code | 7ca940124074d7f7bca28559e0fe2f3cba24f846 | e6678b3dabe21fcd05e362bb8115f7812ad9abb8 | refs/heads/master | 2021-07-25T06:35:22.755474 | 2017-11-04T15:07:50 | 2017-11-04T15:07:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 327 | cpp | #include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main()
{
int chk=0,z=0;
string a,b;
cin>>a>>b;
for(int x=0;x<=5;x++)
{
int t=x+5;
if((b.compare(a.substr(x,x+5))==0))
{
cout<<"1";
chk=1;
break;
}
z++;
}
if(chk==0)
cout<<"0"<<z;
return 0;
}
| [
"dimrishubhi@gmail.com"
] | dimrishubhi@gmail.com |
cbb13f13695efa56b7737fd5556a52cf38b076bc | c44068afcd3e4aa9fb5aa821f102e0380b90a1e0 | /TelevisionGUI/TelevisionGUI/AddObject.h | 83c88e8e2536f1abb745ea9783b92a14f9c0c15b | [] | no_license | mateuszgujda/TelevisionGUI | e4d496bb33995c60ebffb21a84a11195aef016db | 5b15b49c20eef1b0a9c5c1212d73c8082c7da094 | refs/heads/master | 2020-03-19T00:00:19.315229 | 2018-05-29T21:08:22 | 2018-05-29T21:08:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 736 | h | #pragma once
#include <QDialog>
#include "ui_AddObject.h"
#include "display_device.h"
#include "television.h"
#include "smarttv.h"
#include "projector.h"
#include "vector"
class AddObject : public QDialog
{
Q_OBJECT
public:
AddObject(QWidget *parent = Q_NULLPTR);
AddObject(DisplayDevice* device_to_edit);
~AddObject();
DisplayDevice* createdDevice = nullptr;
DisplayDevice* getDevicePointer() { return createdDevice; };
public slots:
Television* newTV();
SmartTv* newSmart();
Projector* newProjector();
void checkText();
void checkAppInput();
void drawAppList();
void onAddApp();
void onRemoveApp();
void appSelected();
void submitForm();
void editSubmit();
private:
Ui::AddObject ui;
vector <string> apps;
}; | [
"31575875+encharter1332@users.noreply.github.com"
] | 31575875+encharter1332@users.noreply.github.com |
c91800386aed636c8fbd374bd49484dc180335d7 | 9f14621793a39a930c0831db84c9309dcc793e20 | /tetris/MyFrame.h | 12b319fb46886b10c69a0b35d35138452b29e4ec | [] | no_license | huanghao870620/myproj | 3d8d75d30a630b33b86b65e354407d0c98731d8b | b2a5aa33a93312399a71a7869376d27e181689ee | refs/heads/master | 2020-04-04T05:40:24.350288 | 2017-02-25T06:17:52 | 2017-02-25T06:17:52 | 52,357,318 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 673 | h | ///////////////////////////////////////////////////////////
// MyFrame.h
// Implementation of the Class MyFrame
// Created on: 23-¾ÅÔÂ-2016 9:04:28
// Original author: huang.hao
///////////////////////////////////////////////////////////
#if !defined(EA_7326DB1D_D818_4548_A664_D03CC0FFA8CF__INCLUDED_)
#define EA_7326DB1D_D818_4548_A664_D03CC0FFA8CF__INCLUDED_
#include<afxwin.h>
class MyFrame : public CFrameWnd
{
public:
MyFrame();
virtual ~MyFrame();
protected:DECLARE_DYNCREATE(MyFrame)
protected:DECLARE_MESSAGE_MAP()
protected:virtual BOOL PreCreateWindow(CREATESTRUCT &cs);
};
#endif // !defined(EA_7326DB1D_D818_4548_A664_D03CC0FFA8CF__INCLUDED_)
| [
"1175210752@qq.com"
] | 1175210752@qq.com |
35d40ff74329033a5169721c4ab5ba139557cbe4 | ccf959315b1b50d28a2583336c6bcdf96e51db49 | /Proy_RetratoRobot/main.cpp | 9ab23c2fff134c1854b2edd422f6e54daf30f379 | [] | no_license | JulianJH/OMI | ffaa2839bcbbe2626f144ce638e9077f36eabbb8 | 20f48b20f6f7e58bbfdba76a6bacb0748d06d378 | refs/heads/master | 2021-10-11T04:28:23.692146 | 2019-01-22T03:29:52 | 2019-01-22T03:29:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 897 | cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string filas[5];
for (int i = 0; i<5; i++)
{
string temp;
getline(cin, filas[i]);
cin.clear();
}
cout<<"hola";
int currFila = 0;
for (int i = 0; i<filas[currFila].size(); i++)
{
if (currFila>=5)
break;
int number = 0;
int digitos = 0;
while (isdigit(filas[currFila][i]))
{
number *= 10;
number += filas[currFila][i]-'0';
digitos++;
}
char caracter = filas[currFila][i+number];
for (int j = 0; j<number; j++)
{
cout<< caracter;
}
cout<<endl;
currFila++;
}
return 0;
}
/*#include <iostream>
using namespace std;
int main()
{
string hola;
getline(cin, hola);
cout<<hola;
return 0;
}*/
| [
"julihereu@hotmail.com"
] | julihereu@hotmail.com |
a99fbdf0e6a9164dc84879813f596096b684a73b | 86ebdb91873eb6baeeb6cd850accdcaf16a5fcb9 | /renderdoc/driver/vulkan/vk_rendermesh.cpp | daa1f126755db0e51d0a53e2cbc46f4b2397a9cf | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | DmitrySoshnikov/renderdoc | a081f136b5faf4fefe7d8024f49f950c526c6717 | b1e6140747182d89dc385aa0fe0b96197b8dae2d | refs/heads/v1.x | 2020-05-05T00:39:48.702189 | 2019-07-01T16:03:38 | 2019-07-01T16:03:38 | 179,582,326 | 1 | 0 | MIT | 2019-07-02T02:54:49 | 2019-04-04T21:49:50 | C++ | UTF-8 | C++ | false | false | 37,839 | cpp | /******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2018-2019 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#include <float.h>
#include "maths/camera.h"
#include "maths/formatpacking.h"
#include "maths/matrix.h"
#include "vk_core.h"
#include "vk_debug.h"
#include "vk_shader_cache.h"
#define VULKAN 1
#include "data/glsl/glsl_ubos_cpp.h"
MeshDisplayPipelines VulkanDebugManager::CacheMeshDisplayPipelines(VkPipelineLayout pipeLayout,
const MeshFormat &primary,
const MeshFormat &secondary)
{
// generate a key to look up the map
uint64_t key = 0;
uint64_t bit = 0;
if(primary.indexByteStride == 4)
key |= 1ULL << bit;
bit++;
RDCASSERT((uint32_t)primary.topology < 64);
key |= uint64_t((uint32_t)primary.topology & 0x3f) << bit;
bit += 6;
VkFormat primaryFmt = MakeVkFormat(primary.format);
VkFormat secondaryFmt = secondary.vertexResourceId == ResourceId()
? VK_FORMAT_UNDEFINED
: MakeVkFormat(secondary.format);
RDCCOMPILE_ASSERT(VK_FORMAT_RANGE_SIZE <= 255,
"Mesh pipeline cache key needs an extra bit for format");
key |= uint64_t((uint32_t)primaryFmt & 0xff) << bit;
bit += 8;
key |= uint64_t((uint32_t)secondaryFmt & 0xff) << bit;
bit += 8;
RDCASSERT(primary.vertexByteStride <= 0xffff);
key |= uint64_t((uint32_t)primary.vertexByteStride & 0xffff) << bit;
bit += 16;
if(secondary.vertexResourceId != ResourceId())
{
RDCASSERT(secondary.vertexByteStride <= 0xffff);
key |= uint64_t((uint32_t)secondary.vertexByteStride & 0xffff) << bit;
}
bit += 16;
if(primary.instanced)
key |= 1ULL << bit;
bit++;
if(secondary.instanced)
key |= 1ULL << bit;
bit++;
// only 64 bits, make sure they all fit
RDCASSERT(bit < 64);
MeshDisplayPipelines &cache = m_CachedMeshPipelines[key];
if(cache.pipes[(uint32_t)SolidShade::NoSolid] != VK_NULL_HANDLE)
return cache;
const VkDevDispatchTable *vt = ObjDisp(m_Device);
VkResult vkr = VK_SUCCESS;
// should we try and evict old pipelines from the cache here?
// or just keep them forever
VkVertexInputBindingDescription binds[] = {
// primary
{0, primary.vertexByteStride,
primary.instanced ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX},
// secondary
{1, secondary.vertexByteStride,
secondary.instanced ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX}};
RDCASSERT(primaryFmt != VK_FORMAT_UNDEFINED);
VkVertexInputAttributeDescription vertAttrs[] = {
// primary
{
0, 0, primaryFmt, 0,
},
// secondary
{
1, 0, primaryFmt, 0,
},
};
VkPipelineVertexInputStateCreateInfo vi = {
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, NULL, 0, 1, binds, 2, vertAttrs,
};
VkPipelineShaderStageCreateInfo stages[3] = {
{VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, NULL, 0, VK_SHADER_STAGE_ALL_GRAPHICS,
VK_NULL_HANDLE, "main", NULL},
{VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, NULL, 0, VK_SHADER_STAGE_ALL_GRAPHICS,
VK_NULL_HANDLE, "main", NULL},
{VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, NULL, 0, VK_SHADER_STAGE_ALL_GRAPHICS,
VK_NULL_HANDLE, "main", NULL},
};
VkPipelineInputAssemblyStateCreateInfo ia = {
VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, NULL, 0,
primary.topology >= Topology::PatchList ? VK_PRIMITIVE_TOPOLOGY_POINT_LIST
: MakeVkPrimitiveTopology(primary.topology),
false,
};
if(IsStrip(primary.topology))
{
ia.primitiveRestartEnable = true;
}
VkRect2D scissor = {{0, 0}, {16384, 16384}};
VkPipelineViewportStateCreateInfo vp = {
VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, NULL, 0, 1, NULL, 1, &scissor};
VkPipelineRasterizationStateCreateInfo rs = {
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
NULL,
0,
false,
false,
VK_POLYGON_MODE_FILL,
VK_CULL_MODE_NONE,
VK_FRONT_FACE_CLOCKWISE,
false,
0.0f,
0.0f,
0.0f,
1.0f,
};
VkPipelineMultisampleStateCreateInfo msaa = {
VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
NULL,
0,
VULKAN_MESH_VIEW_SAMPLES,
false,
0.0f,
NULL,
false,
false};
VkPipelineDepthStencilStateCreateInfo ds = {
VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO,
NULL,
0,
true,
true,
VK_COMPARE_OP_LESS_OR_EQUAL,
false,
false,
{VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_ALWAYS, 0, 0, 0},
{VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_ALWAYS, 0, 0, 0},
0.0f,
1.0f,
};
VkPipelineColorBlendAttachmentState attState = {
false,
VK_BLEND_FACTOR_ONE,
VK_BLEND_FACTOR_ZERO,
VK_BLEND_OP_ADD,
VK_BLEND_FACTOR_ONE,
VK_BLEND_FACTOR_ZERO,
VK_BLEND_OP_ADD,
0xf,
};
VkPipelineColorBlendStateCreateInfo cb = {
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
NULL,
0,
false,
VK_LOGIC_OP_NO_OP,
1,
&attState,
{1.0f, 1.0f, 1.0f, 1.0f}};
VkDynamicState dynstates[] = {VK_DYNAMIC_STATE_VIEWPORT};
VkPipelineDynamicStateCreateInfo dyn = {
VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
NULL,
0,
ARRAY_COUNT(dynstates),
dynstates,
};
VkRenderPass rp; // compatible render pass
{
VkAttachmentDescription attDesc[] = {
{0, VK_FORMAT_R8G8B8A8_SRGB, VULKAN_MESH_VIEW_SAMPLES, VK_ATTACHMENT_LOAD_OP_LOAD,
VK_ATTACHMENT_STORE_OP_STORE, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_ATTACHMENT_STORE_OP_DONT_CARE, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL},
{0, VK_FORMAT_D32_SFLOAT, VULKAN_MESH_VIEW_SAMPLES, VK_ATTACHMENT_LOAD_OP_LOAD,
VK_ATTACHMENT_STORE_OP_STORE, VK_ATTACHMENT_LOAD_OP_DONT_CARE,
VK_ATTACHMENT_STORE_OP_DONT_CARE, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL},
};
VkAttachmentReference attRef = {0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL};
VkAttachmentReference dsRef = {1, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL};
VkSubpassDescription sub = {
0, VK_PIPELINE_BIND_POINT_GRAPHICS,
0, NULL, // inputs
1, &attRef, // color
NULL, // resolve
&dsRef, // depth-stencil
0, NULL, // preserve
};
VkRenderPassCreateInfo rpinfo = {
VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
NULL,
0,
2,
attDesc,
1,
&sub,
0,
NULL, // dependencies
};
vt->CreateRenderPass(Unwrap(m_Device), &rpinfo, NULL, &rp);
}
VkGraphicsPipelineCreateInfo pipeInfo = {
VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
NULL,
0,
2,
stages,
&vi,
&ia,
NULL, // tess
&vp,
&rs,
&msaa,
&ds,
&cb,
&dyn,
Unwrap(pipeLayout),
rp,
0, // sub pass
VK_NULL_HANDLE, // base pipeline handle
0, // base pipeline index
};
// wireframe pipeline
stages[0].module = Unwrap(m_pDriver->GetShaderCache()->GetBuiltinModule(BuiltinShader::MeshVS));
stages[0].stage = VK_SHADER_STAGE_VERTEX_BIT;
stages[1].module = Unwrap(m_pDriver->GetShaderCache()->GetBuiltinModule(BuiltinShader::MeshFS));
stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
rs.polygonMode = VK_POLYGON_MODE_LINE;
rs.lineWidth = 1.0f;
ds.depthTestEnable = false;
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_Wire]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
ds.depthTestEnable = true;
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_WireDepth]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
// solid shading pipeline
rs.polygonMode = VK_POLYGON_MODE_FILL;
ds.depthTestEnable = false;
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_Solid]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
ds.depthTestEnable = true;
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_SolidDepth]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
if(secondary.vertexResourceId != ResourceId())
{
// pull secondary information from second vertex buffer
vertAttrs[1].binding = 1;
vertAttrs[1].format = secondaryFmt;
RDCASSERT(secondaryFmt != VK_FORMAT_UNDEFINED);
vi.vertexBindingDescriptionCount = 2;
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_Secondary]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
}
vertAttrs[1].binding = 0;
vi.vertexBindingDescriptionCount = 1;
// flat lit pipeline, needs geometry shader to calculate face normals
stages[2].module = Unwrap(m_pDriver->GetShaderCache()->GetBuiltinModule(BuiltinShader::MeshGS));
stages[2].stage = VK_SHADER_STAGE_GEOMETRY_BIT;
pipeInfo.stageCount = 3;
if(stages[2].module != VK_NULL_HANDLE)
{
vkr = vt->CreateGraphicsPipelines(Unwrap(m_Device), VK_NULL_HANDLE, 1, &pipeInfo, NULL,
&cache.pipes[MeshDisplayPipelines::ePipe_Lit]);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
}
for(uint32_t i = 0; i < MeshDisplayPipelines::ePipe_Count; i++)
if(cache.pipes[i] != VK_NULL_HANDLE)
m_pDriver->GetResourceManager()->WrapResource(Unwrap(m_Device), cache.pipes[i]);
vt->DestroyRenderPass(Unwrap(m_Device), rp, NULL);
return cache;
}
void VulkanReplay::RenderMesh(uint32_t eventId, const std::vector<MeshFormat> &secondaryDraws,
const MeshDisplay &cfg)
{
if(cfg.position.vertexResourceId == ResourceId() || cfg.position.numIndices == 0)
return;
auto it = m_OutputWindows.find(m_ActiveWinID);
if(m_ActiveWinID == 0 || it == m_OutputWindows.end())
return;
OutputWindow &outw = it->second;
// if the swapchain failed to create, do nothing. We will try to recreate it
// again in CheckResizeOutputWindow (once per render 'frame')
if(outw.m_WindowSystem != WindowingSystem::Headless && outw.swap == VK_NULL_HANDLE)
return;
VkDevice dev = m_pDriver->GetDev();
VkCommandBuffer cmd = m_pDriver->GetNextCmd();
const VkDevDispatchTable *vt = ObjDisp(dev);
VkResult vkr = VK_SUCCESS;
VkCommandBufferBeginInfo beginInfo = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, NULL,
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};
vkr = vt->BeginCommandBuffer(Unwrap(cmd), &beginInfo);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
VkMarkerRegion::Begin(
StringFormat::Fmt("RenderMesh with %zu secondary draws", secondaryDraws.size()), cmd);
VkRenderPassBeginInfo rpbegin = {
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
NULL,
Unwrap(outw.rpdepth),
Unwrap(outw.fbdepth),
{{
0, 0,
},
{m_DebugWidth, m_DebugHeight}},
0,
NULL,
};
vt->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
VkViewport viewport = {0.0f, 0.0f, (float)m_DebugWidth, (float)m_DebugHeight, 0.0f, 1.0f};
vt->CmdSetViewport(Unwrap(cmd), 0, 1, &viewport);
Matrix4f projMat =
Matrix4f::Perspective(90.0f, 0.1f, 100000.0f, float(m_DebugWidth) / float(m_DebugHeight));
Matrix4f InvProj = projMat.Inverse();
Matrix4f camMat = cfg.cam ? ((Camera *)cfg.cam)->GetMatrix() : Matrix4f::Identity();
Matrix4f ModelViewProj = projMat.Mul(camMat);
Matrix4f guessProjInv;
if(cfg.position.unproject)
{
// the derivation of the projection matrix might not be right (hell, it could be an
// orthographic projection). But it'll be close enough likely.
Matrix4f guessProj =
cfg.position.farPlane != FLT_MAX
? Matrix4f::Perspective(cfg.fov, cfg.position.nearPlane, cfg.position.farPlane, cfg.aspect)
: Matrix4f::ReversePerspective(cfg.fov, cfg.position.nearPlane, cfg.aspect);
if(cfg.ortho)
{
guessProj = Matrix4f::Orthographic(cfg.position.nearPlane, cfg.position.farPlane);
}
guessProjInv = guessProj.Inverse();
ModelViewProj = projMat.Mul(camMat.Mul(guessProjInv));
}
if(!secondaryDraws.empty())
{
size_t mapsUsed = 0;
for(size_t i = 0; i < secondaryDraws.size(); i++)
{
const MeshFormat &fmt = secondaryDraws[i];
if(fmt.vertexResourceId != ResourceId())
{
// TODO should move the color to a push constant so we don't have to map all the time
uint32_t uboOffs = 0;
MeshUBOData *data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
data->mvp = ModelViewProj;
data->color = Vec4f(fmt.meshColor.x, fmt.meshColor.y, fmt.meshColor.z, fmt.meshColor.w);
data->homogenousInput = cfg.position.unproject;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->displayFormat = MESHDISPLAY_SOLID;
data->rawoutput = 0;
m_MeshRender.UBO.Unmap();
mapsUsed++;
if(mapsUsed + 1 >= m_MeshRender.UBO.GetRingCount())
{
// flush and sync so we can use more maps
vt->CmdEndRenderPass(Unwrap(cmd));
vkr = vt->EndCommandBuffer(Unwrap(cmd));
RDCASSERTEQUAL(vkr, VK_SUCCESS);
m_pDriver->SubmitCmds();
m_pDriver->FlushQ();
mapsUsed = 0;
cmd = m_pDriver->GetNextCmd();
vkr = vt->BeginCommandBuffer(Unwrap(cmd), &beginInfo);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
vt->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
vt->CmdSetViewport(Unwrap(cmd), 0, 1, &viewport);
}
MeshDisplayPipelines secondaryCache = GetDebugManager()->CacheMeshDisplayPipelines(
m_MeshRender.PipeLayout, secondaryDraws[i], secondaryDraws[i]);
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(secondaryCache.pipes[MeshDisplayPipelines::ePipe_WireDepth]));
VkBuffer vb =
m_pDriver->GetResourceManager()->GetCurrentHandle<VkBuffer>(fmt.vertexResourceId);
VkDeviceSize offs = fmt.vertexByteOffset;
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(vb), &offs);
if(fmt.indexByteStride)
{
VkIndexType idxtype = VK_INDEX_TYPE_UINT16;
if(fmt.indexByteStride == 4)
idxtype = VK_INDEX_TYPE_UINT32;
if(fmt.indexResourceId != ResourceId())
{
VkBuffer ib =
m_pDriver->GetResourceManager()->GetLiveHandle<VkBuffer>(fmt.indexResourceId);
vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), fmt.indexByteOffset, idxtype);
}
vt->CmdDrawIndexed(Unwrap(cmd), fmt.numIndices, 1, 0, fmt.baseVertex, 0);
}
else
{
vt->CmdDraw(Unwrap(cmd), fmt.numIndices, 1, 0, 0);
}
}
}
{
// flush and sync so we can use more maps
vt->CmdEndRenderPass(Unwrap(cmd));
vkr = vt->EndCommandBuffer(Unwrap(cmd));
RDCASSERTEQUAL(vkr, VK_SUCCESS);
m_pDriver->SubmitCmds();
m_pDriver->FlushQ();
cmd = m_pDriver->GetNextCmd();
vkr = vt->BeginCommandBuffer(Unwrap(cmd), &beginInfo);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
vt->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
vt->CmdSetViewport(Unwrap(cmd), 0, 1, &viewport);
}
}
MeshDisplayPipelines cache = GetDebugManager()->CacheMeshDisplayPipelines(
m_MeshRender.PipeLayout, cfg.position, cfg.second);
if(cfg.position.vertexResourceId != ResourceId())
{
VkBuffer vb =
m_pDriver->GetResourceManager()->GetCurrentHandle<VkBuffer>(cfg.position.vertexResourceId);
VkDeviceSize offs = cfg.position.vertexByteOffset;
// we source all data from the first instanced value in the instanced case, so make sure we
// offset correctly here.
if(cfg.position.instanced)
offs += cfg.position.vertexByteStride * (cfg.curInstance / cfg.position.instStepRate);
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(vb), &offs);
}
SolidShade solidShadeMode = cfg.solidShadeMode;
// can't support secondary shading without a buffer - no pipeline will have been created
if(solidShadeMode == SolidShade::Secondary && cfg.second.vertexResourceId == ResourceId())
solidShadeMode = SolidShade::NoSolid;
if(solidShadeMode == SolidShade::Secondary)
{
VkBuffer vb =
m_pDriver->GetResourceManager()->GetCurrentHandle<VkBuffer>(cfg.second.vertexResourceId);
VkDeviceSize offs = cfg.second.vertexByteOffset;
// we source all data from the first instanced value in the instanced case, so make sure we
// offset correctly here.
if(cfg.second.instanced)
offs += cfg.second.vertexByteStride * (cfg.curInstance / cfg.second.instStepRate);
vt->CmdBindVertexBuffers(Unwrap(cmd), 1, 1, UnwrapPtr(vb), &offs);
}
// solid render
if(solidShadeMode != SolidShade::NoSolid && cfg.position.topology < Topology::PatchList)
{
VkPipeline pipe = VK_NULL_HANDLE;
switch(solidShadeMode)
{
default:
case SolidShade::Solid: pipe = cache.pipes[MeshDisplayPipelines::ePipe_SolidDepth]; break;
case SolidShade::Lit: pipe = cache.pipes[MeshDisplayPipelines::ePipe_Lit]; break;
case SolidShade::Secondary: pipe = cache.pipes[MeshDisplayPipelines::ePipe_Secondary]; break;
}
// can't support lit rendering without the pipeline - maybe geometry shader wasn't supported.
if(solidShadeMode == SolidShade::Lit && pipe == VK_NULL_HANDLE)
pipe = cache.pipes[MeshDisplayPipelines::ePipe_SolidDepth];
uint32_t uboOffs = 0;
MeshUBOData *data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
if(solidShadeMode == SolidShade::Lit)
data->invProj = projMat.Inverse();
data->mvp = ModelViewProj;
data->color = Vec4f(0.8f, 0.8f, 0.0f, 1.0f);
data->homogenousInput = cfg.position.unproject;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->displayFormat = (uint32_t)solidShadeMode;
data->rawoutput = 0;
if(solidShadeMode == SolidShade::Secondary && cfg.second.showAlpha)
data->displayFormat = MESHDISPLAY_SECONDARY_ALPHA;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, Unwrap(pipe));
if(cfg.position.indexByteStride)
{
VkIndexType idxtype = VK_INDEX_TYPE_UINT16;
if(cfg.position.indexByteStride == 4)
idxtype = VK_INDEX_TYPE_UINT32;
if(cfg.position.indexResourceId != ResourceId())
{
VkBuffer ib =
m_pDriver->GetResourceManager()->GetCurrentHandle<VkBuffer>(cfg.position.indexResourceId);
vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), cfg.position.indexByteOffset, idxtype);
}
vt->CmdDrawIndexed(Unwrap(cmd), cfg.position.numIndices, 1, 0, cfg.position.baseVertex, 0);
}
else
{
vt->CmdDraw(Unwrap(cmd), cfg.position.numIndices, 1, 0, 0);
}
}
// wireframe render
if(solidShadeMode == SolidShade::NoSolid || cfg.wireframeDraw ||
cfg.position.topology >= Topology::PatchList)
{
Vec4f wireCol =
Vec4f(cfg.position.meshColor.x, cfg.position.meshColor.y, cfg.position.meshColor.z, 1.0f);
uint32_t uboOffs = 0;
MeshUBOData *data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
data->mvp = ModelViewProj;
data->color = wireCol;
data->displayFormat = (uint32_t)SolidShade::Solid;
data->homogenousInput = cfg.position.unproject;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->rawoutput = 0;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(cache.pipes[MeshDisplayPipelines::ePipe_WireDepth]));
if(cfg.position.indexByteStride)
{
VkIndexType idxtype = VK_INDEX_TYPE_UINT16;
if(cfg.position.indexByteStride == 4)
idxtype = VK_INDEX_TYPE_UINT32;
if(cfg.position.indexResourceId != ResourceId())
{
VkBuffer ib =
m_pDriver->GetResourceManager()->GetCurrentHandle<VkBuffer>(cfg.position.indexResourceId);
vt->CmdBindIndexBuffer(Unwrap(cmd), Unwrap(ib), cfg.position.indexByteOffset, idxtype);
}
vt->CmdDrawIndexed(Unwrap(cmd), cfg.position.numIndices, 1, 0, cfg.position.baseVertex, 0);
}
else
{
vt->CmdDraw(Unwrap(cmd), cfg.position.numIndices, 1, 0, 0);
}
}
MeshFormat helper;
helper.indexByteStride = 2;
helper.topology = Topology::LineList;
helper.format.type = ResourceFormatType::Regular;
helper.format.compByteWidth = 4;
helper.format.compCount = 4;
helper.format.compType = CompType::Float;
helper.vertexByteStride = sizeof(Vec4f);
// cache pipelines for use in drawing wireframe helpers
cache = GetDebugManager()->CacheMeshDisplayPipelines(m_MeshRender.PipeLayout, helper, helper);
if(cfg.showBBox)
{
Vec4f a = Vec4f(cfg.minBounds.x, cfg.minBounds.y, cfg.minBounds.z, cfg.minBounds.w);
Vec4f b = Vec4f(cfg.maxBounds.x, cfg.maxBounds.y, cfg.maxBounds.z, cfg.maxBounds.w);
Vec4f TLN = Vec4f(a.x, b.y, a.z, 1.0f); // TopLeftNear, etc...
Vec4f TRN = Vec4f(b.x, b.y, a.z, 1.0f);
Vec4f BLN = Vec4f(a.x, a.y, a.z, 1.0f);
Vec4f BRN = Vec4f(b.x, a.y, a.z, 1.0f);
Vec4f TLF = Vec4f(a.x, b.y, b.z, 1.0f);
Vec4f TRF = Vec4f(b.x, b.y, b.z, 1.0f);
Vec4f BLF = Vec4f(a.x, a.y, b.z, 1.0f);
Vec4f BRF = Vec4f(b.x, a.y, b.z, 1.0f);
// 12 frustum lines => 24 verts
Vec4f bbox[24] = {
TLN, TRN, TRN, BRN, BRN, BLN, BLN, TLN,
TLN, TLF, TRN, TRF, BLN, BLF, BRN, BRF,
TLF, TRF, TRF, BRF, BRF, BLF, BLF, TLF,
};
VkDeviceSize vboffs = 0;
Vec4f *ptr = (Vec4f *)m_MeshRender.BBoxVB.Map(vboffs);
memcpy(ptr, bbox, sizeof(bbox));
m_MeshRender.BBoxVB.Unmap();
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(m_MeshRender.BBoxVB.buf), &vboffs);
uint32_t uboOffs = 0;
MeshUBOData *data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
data->mvp = ModelViewProj;
data->color = Vec4f(0.2f, 0.2f, 1.0f, 1.0f);
data->displayFormat = (uint32_t)SolidShade::Solid;
data->homogenousInput = 0;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->rawoutput = 0;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(cache.pipes[MeshDisplayPipelines::ePipe_WireDepth]));
vt->CmdDraw(Unwrap(cmd), 24, 1, 0, 0);
}
// draw axis helpers
if(!cfg.position.unproject)
{
VkDeviceSize vboffs = 0;
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(m_MeshRender.AxisFrustumVB.buf), &vboffs);
uint32_t uboOffs = 0;
MeshUBOData *data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
data->mvp = ModelViewProj;
data->color = Vec4f(1.0f, 0.0f, 0.0f, 1.0f);
data->displayFormat = (uint32_t)SolidShade::Solid;
data->homogenousInput = 0;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->rawoutput = 0;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(cache.pipes[MeshDisplayPipelines::ePipe_Wire]));
vt->CmdDraw(Unwrap(cmd), 2, 1, 0, 0);
// poke the color (this would be a good candidate for a push constant)
data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
data->mvp = ModelViewProj;
data->color = Vec4f(0.0f, 1.0f, 0.0f, 1.0f);
data->displayFormat = (uint32_t)SolidShade::Solid;
data->homogenousInput = 0;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->rawoutput = 0;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdDraw(Unwrap(cmd), 2, 1, 2, 0);
data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
data->mvp = ModelViewProj;
data->color = Vec4f(0.0f, 0.0f, 1.0f, 1.0f);
data->displayFormat = (uint32_t)SolidShade::Solid;
data->homogenousInput = 0;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->rawoutput = 0;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdDraw(Unwrap(cmd), 2, 1, 4, 0);
}
// 'fake' helper frustum
if(cfg.position.unproject)
{
VkDeviceSize vboffs = sizeof(Vec4f) * 6; // skim the axis helpers
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(m_MeshRender.AxisFrustumVB.buf), &vboffs);
uint32_t uboOffs = 0;
MeshUBOData *data = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
data->mvp = ModelViewProj;
data->color = Vec4f(1.0f, 1.0f, 1.0f, 1.0f);
data->displayFormat = (uint32_t)SolidShade::Solid;
data->homogenousInput = 0;
data->pointSpriteSize = Vec2f(0.0f, 0.0f);
data->rawoutput = 0;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(cache.pipes[MeshDisplayPipelines::ePipe_Wire]));
vt->CmdDraw(Unwrap(cmd), 24, 1, 0, 0);
}
// show highlighted vertex
if(cfg.highlightVert != ~0U)
{
{
// need to end our cmd buffer, it might be submitted in GetBufferData when caching highlight
// data
vt->CmdEndRenderPass(Unwrap(cmd));
vkr = vt->EndCommandBuffer(Unwrap(cmd));
RDCASSERTEQUAL(vkr, VK_SUCCESS);
#if ENABLED(SINGLE_FLUSH_VALIDATE)
m_pDriver->SubmitCmds();
#endif
}
m_HighlightCache.CacheHighlightingData(eventId, cfg);
{
// get a new cmdbuffer and begin it
cmd = m_pDriver->GetNextCmd();
vkr = vt->BeginCommandBuffer(Unwrap(cmd), &beginInfo);
RDCASSERTEQUAL(vkr, VK_SUCCESS);
vt->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
vt->CmdSetViewport(Unwrap(cmd), 0, 1, &viewport);
}
Topology meshtopo = cfg.position.topology;
///////////////////////////////////////////////////////////////
// vectors to be set from buffers, depending on topology
// this vert (blue dot, required)
FloatVector activeVertex;
// primitive this vert is a part of (red prim, optional)
std::vector<FloatVector> activePrim;
// for patch lists, to show other verts in patch (green dots, optional)
// for non-patch lists, we use the activePrim and adjacentPrimVertices
// to show what other verts are related
std::vector<FloatVector> inactiveVertices;
// adjacency (line or tri, strips or lists) (green prims, optional)
// will be N*M long, N adjacent prims of M verts each. M = primSize below
std::vector<FloatVector> adjacentPrimVertices;
helper.topology = Topology::TriangleList;
uint32_t primSize = 3; // number of verts per primitive
if(meshtopo == Topology::LineList || meshtopo == Topology::LineStrip ||
meshtopo == Topology::LineList_Adj || meshtopo == Topology::LineStrip_Adj)
{
primSize = 2;
helper.topology = Topology::LineList;
}
else
{
// update the cache, as it's currently linelist
helper.topology = Topology::TriangleList;
cache = GetDebugManager()->CacheMeshDisplayPipelines(m_MeshRender.PipeLayout, helper, helper);
}
bool valid = m_HighlightCache.FetchHighlightPositions(cfg, activeVertex, activePrim,
adjacentPrimVertices, inactiveVertices);
if(valid)
{
////////////////////////////////////////////////////////////////
// prepare rendering (for both vertices & primitives)
// if data is from post transform, it will be in clipspace
if(cfg.position.unproject)
ModelViewProj = projMat.Mul(camMat.Mul(guessProjInv));
else
ModelViewProj = projMat.Mul(camMat);
MeshUBOData uniforms = {};
uniforms.mvp = ModelViewProj;
uniforms.color = Vec4f(1.0f, 1.0f, 1.0f, 1.0f);
uniforms.displayFormat = (uint32_t)SolidShade::Solid;
uniforms.homogenousInput = cfg.position.unproject;
uniforms.pointSpriteSize = Vec2f(0.0f, 0.0f);
uint32_t uboOffs = 0;
MeshUBOData *ubodata = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
*ubodata = uniforms;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(cache.pipes[MeshDisplayPipelines::ePipe_Solid]));
////////////////////////////////////////////////////////////////
// render primitives
// Draw active primitive (red)
uniforms.color = Vec4f(1.0f, 0.0f, 0.0f, 1.0f);
// poke the color (this would be a good candidate for a push constant)
ubodata = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
*ubodata = uniforms;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
if(activePrim.size() >= primSize)
{
VkDeviceSize vboffs = 0;
Vec4f *ptr = (Vec4f *)m_MeshRender.BBoxVB.Map(vboffs, sizeof(Vec4f) * primSize);
memcpy(ptr, &activePrim[0], sizeof(Vec4f) * primSize);
m_MeshRender.BBoxVB.Unmap();
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(m_MeshRender.BBoxVB.buf), &vboffs);
vt->CmdDraw(Unwrap(cmd), primSize, 1, 0, 0);
}
// Draw adjacent primitives (green)
uniforms.color = Vec4f(0.0f, 1.0f, 0.0f, 1.0f);
// poke the color (this would be a good candidate for a push constant)
ubodata = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
*ubodata = uniforms;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
if(adjacentPrimVertices.size() >= primSize && (adjacentPrimVertices.size() % primSize) == 0)
{
VkDeviceSize vboffs = 0;
Vec4f *ptr =
(Vec4f *)m_MeshRender.BBoxVB.Map(vboffs, sizeof(Vec4f) * adjacentPrimVertices.size());
memcpy(ptr, &adjacentPrimVertices[0], sizeof(Vec4f) * adjacentPrimVertices.size());
m_MeshRender.BBoxVB.Unmap();
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(m_MeshRender.BBoxVB.buf), &vboffs);
vt->CmdDraw(Unwrap(cmd), (uint32_t)adjacentPrimVertices.size(), 1, 0, 0);
}
////////////////////////////////////////////////////////////////
// prepare to render dots
float scale = 800.0f / float(m_DebugHeight);
float asp = float(m_DebugWidth) / float(m_DebugHeight);
uniforms.pointSpriteSize = Vec2f(scale / asp, scale);
// Draw active vertex (blue)
uniforms.color = Vec4f(0.0f, 0.0f, 1.0f, 1.0f);
// poke the color (this would be a good candidate for a push constant)
ubodata = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
*ubodata = uniforms;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
// vertices are drawn with tri strips
helper.topology = Topology::TriangleStrip;
cache = GetDebugManager()->CacheMeshDisplayPipelines(m_MeshRender.PipeLayout, helper, helper);
FloatVector vertSprite[4] = {
activeVertex, activeVertex, activeVertex, activeVertex,
};
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
vt->CmdBindPipeline(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(cache.pipes[MeshDisplayPipelines::ePipe_Solid]));
{
VkDeviceSize vboffs = 0;
Vec4f *ptr = (Vec4f *)m_MeshRender.BBoxVB.Map(vboffs, sizeof(vertSprite));
memcpy(ptr, &vertSprite[0], sizeof(vertSprite));
m_MeshRender.BBoxVB.Unmap();
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(m_MeshRender.BBoxVB.buf), &vboffs);
vt->CmdDraw(Unwrap(cmd), 4, 1, 0, 0);
}
// Draw inactive vertices (green)
uniforms.color = Vec4f(0.0f, 1.0f, 0.0f, 1.0f);
// poke the color (this would be a good candidate for a push constant)
ubodata = (MeshUBOData *)m_MeshRender.UBO.Map(&uboOffs);
*ubodata = uniforms;
m_MeshRender.UBO.Unmap();
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
Unwrap(m_MeshRender.PipeLayout), 0, 1,
UnwrapPtr(m_MeshRender.DescSet), 1, &uboOffs);
if(!inactiveVertices.empty())
{
VkDeviceSize vboffs = 0;
FloatVector *ptr = (FloatVector *)m_MeshRender.BBoxVB.Map(vboffs, sizeof(vertSprite));
for(size_t i = 0; i < inactiveVertices.size(); i++)
{
*ptr++ = inactiveVertices[i];
*ptr++ = inactiveVertices[i];
*ptr++ = inactiveVertices[i];
*ptr++ = inactiveVertices[i];
}
m_MeshRender.BBoxVB.Unmap();
for(size_t i = 0; i < inactiveVertices.size(); i++)
{
vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(m_MeshRender.BBoxVB.buf), &vboffs);
vt->CmdDraw(Unwrap(cmd), 4, 1, 0, 0);
vboffs += sizeof(FloatVector) * 4;
}
}
}
}
vt->CmdEndRenderPass(Unwrap(cmd));
VkMarkerRegion::End(cmd);
vkr = vt->EndCommandBuffer(Unwrap(cmd));
RDCASSERTEQUAL(vkr, VK_SUCCESS);
#if ENABLED(SINGLE_FLUSH_VALIDATE)
m_pDriver->SubmitCmds();
#endif
}
| [
"baldurk@baldurk.org"
] | baldurk@baldurk.org |
1580adb426d4da4c7c05965a3ecd7e32dce5f5cf | b2b19a0a7a3c0c2da70f81ae6527556b487619d9 | /src/span.h | 39a8e05de6a501ff08f784a841aaea440eef63df | [
"MIT"
] | permissive | Gleecs/GleecBTC-FullNode-Win-Mac-Linux | 804755d3b84e039992c477b267c7c433ef516ef3 | 6f37c56c08e33055b847d37d6e2d1552b69ca7eb | refs/heads/gleecbtc | 2023-05-21T13:58:46.211759 | 2021-06-11T14:52:19 | 2021-06-11T14:52:19 | 186,851,304 | 5 | 2 | MIT | 2021-06-11T14:52:20 | 2019-05-15T15:10:09 | C++ | UTF-8 | C++ | false | false | 3,004 | h | // Copyright (c) 2018 The GleecBTC Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef GLEECBTC_SPAN_H
#define GLEECBTC_SPAN_H
#include <type_traits>
#include <cstddef>
#include <algorithm>
/** A Span is an object that can refer to a contiguous sequence of objects.
*
* It implements a subset of C++20's std::span.
*/
template<typename C>
class Span
{
C* m_data;
std::ptrdiff_t m_size;
public:
constexpr Span() noexcept : m_data(nullptr), m_size(0) {}
constexpr Span(C* data, std::ptrdiff_t size) noexcept : m_data(data), m_size(size) {}
constexpr Span(C* data, C* end) noexcept : m_data(data), m_size(end - data) {}
constexpr C* data() const noexcept { return m_data; }
constexpr C* begin() const noexcept { return m_data; }
constexpr C* end() const noexcept { return m_data + m_size; }
constexpr std::ptrdiff_t size() const noexcept { return m_size; }
constexpr C& operator[](std::ptrdiff_t pos) const noexcept { return m_data[pos]; }
constexpr Span<C> subspan(std::ptrdiff_t offset) const noexcept { return Span<C>(m_data + offset, m_size - offset); }
constexpr Span<C> subspan(std::ptrdiff_t offset, std::ptrdiff_t count) const noexcept { return Span<C>(m_data + offset, count); }
constexpr Span<C> first(std::ptrdiff_t count) const noexcept { return Span<C>(m_data, count); }
constexpr Span<C> last(std::ptrdiff_t count) const noexcept { return Span<C>(m_data + m_size - count, count); }
friend constexpr bool operator==(const Span& a, const Span& b) noexcept { return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin()); }
friend constexpr bool operator!=(const Span& a, const Span& b) noexcept { return !(a == b); }
friend constexpr bool operator<(const Span& a, const Span& b) noexcept { return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end()); }
friend constexpr bool operator<=(const Span& a, const Span& b) noexcept { return !(b < a); }
friend constexpr bool operator>(const Span& a, const Span& b) noexcept { return (b < a); }
friend constexpr bool operator>=(const Span& a, const Span& b) noexcept { return !(a < b); }
};
/** Create a span to a container exposing data() and size().
*
* This correctly deals with constness: the returned Span's element type will be
* whatever data() returns a pointer to. If either the passed container is const,
* or its element type is const, the resulting span will have a const element type.
*
* std::span will have a constructor that implements this functionality directly.
*/
template<typename A, int N>
constexpr Span<A> MakeSpan(A (&a)[N]) { return Span<A>(a, N); }
template<typename V>
constexpr Span<typename std::remove_pointer<decltype(std::declval<V>().data())>::type> MakeSpan(V& v) { return Span<typename std::remove_pointer<decltype(std::declval<V>().data())>::type>(v.data(), v.size()); }
#endif
| [
"admin@gleec.com"
] | admin@gleec.com |
2c01993bce196d19ebd6aaf8abe3f067b25d75d7 | 65cc76b62e0e6b8074f674bd427b694f50f75c96 | /main.cpp | 964a67fecfc557a03247b158b2671f62bba55b05 | [] | no_license | akshaygb28/usc_csci_561_hw1 | c1428e7f974084949c2a7f53cf43c3a8571637c8 | 2c3964b3867f5e2f60c365e503b5dac5a68cb3b1 | refs/heads/master | 2021-04-30T15:57:18.312130 | 2016-09-22T05:45:57 | 2016-09-22T05:45:57 | 68,681,304 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,013 | cpp | #include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
char start_state[100];
char goal_state[100];
int live_traffic_lines;
int sunday_traffic_lines;
int *sunday_traffic_time;
vector<vector<int> > graph;
map <string, int> location;
map <int, string> location_inv;
map <pair<int, int>, int> travel_time;
FILE *fp, *out;
void bfs(int, int);
void dfs(int, int);
void ucs(int, int);
void a_star(int, int);
int main(int argc, char const *argv[])
{
//FILE *fp, *out;
fp = fopen("input1.txt", "r");
out= fopen("output.txt", "w");
char search[5], from[100], to[100], place[100];
//string from, to;
int time, location_count = 0;
//map<pair<string, string>, int> maps;
fscanf(fp, "%s", search);
fscanf(fp, "%s", start_state);
fscanf(fp, "%s", goal_state);
fscanf(fp, "%d", &live_traffic_lines);
//printf("%s %s %s %d ", search, start_state, goal_state, live_traffic_lines);
//fprintf(out, "%s %s %s %d ", search, start_state, goal_state, live_traffic_lines);
graph.resize(live_traffic_lines);
for(int i = 0; i < live_traffic_lines; i++)
{
fscanf(fp, "%s %s %d", from, to, &time);
printf("%s %s %d \n", from, to, time);
//fprintf(out, "%s %s %d \n", from, to, time);
if(location.count(from) == 0)
{
location.insert(make_pair(string(from), location_count));
location_inv.insert(make_pair(location_count, string(from)));
location_count++;
}
if(location.count(to) == 0)
{
location.insert(make_pair(string(to), location_count));
location_inv.insert(make_pair(location_count, string(to)));
location_count++;
}
//cout<<"-->"<<location[from]<<" "<<location[to]<<endl;
graph[location[from]].push_back(location[to]);
travel_time.insert(make_pair(make_pair(location[from], location[to]), time));
}
fscanf(fp, "%d", &sunday_traffic_lines);
//fprintf(out, "%d ", sunday_traffic_lines);
sunday_traffic_time = (int *)malloc(sunday_traffic_lines * sizeof(int));
for(int i = 0; i < sunday_traffic_lines; i++)
{
fscanf(fp, "%s %d", place, &time);
//fprintf(out, "%s %d ", place, time);
sunday_traffic_time[location[place]] = time;
}/*
cout<<"\n\n ----- \n";
for(int i = 0; i < sunday_traffic_lines; i++)
{
cout<<sunday_traffic_time[i]<<endl;
}
cout<<"\n ----- \n\n";*/
if(!strcmp(search, "BFS"))
{
bfs(location[string(start_state)], location[string(goal_state)]);
}
else if(!strcmp(search, "DFS"))
{
dfs(location[string(start_state)], location[string(goal_state)]);
}
else if(!strcmp(search, "UCS"))
{
ucs(location[string(start_state)], location[string(goal_state)]);
}
else if(!strcmp(search, "A*"))
{
a_star(location[string(start_state)], location[string(goal_state)]);
}
fclose(fp);
fclose(out);
return 0;
}
void bfs(int source, int destination)
{
cout<<"BFS : "<<source<<"->"<<destination<<endl;
vector <int> path;
queue <vector <int> > q;
int path_last_node;
path.push_back(source);
q.push(path);
while(!q.empty())
{
path = q.front();
q.pop();
path_last_node = path[path.size() - 1];
if(path_last_node == destination)
{
cout<<"The Required path is:: \n";
//print_path(path);
for (int i = 0; i < path.size(); i++)
{
printf("%s %d\n", (char *)location_inv[path[i]].c_str(), i);
fprintf(out, "%s %d\n", (char *)location_inv[path[i]].c_str(), i);
}
return;
}
for(int i = 0; i < graph[path_last_node].size(); i++)
{
if(find(path.begin(), path.end(), graph[path_last_node][i]) == path.end())
{
vector <int> new_path(path.begin(), path.end());
new_path.push_back(graph[path_last_node][i]);
q.push(new_path);
}
}
}
}
void dfs(int source, int destination)
{
cout<<"DFS : "<<source<<"->"<<destination<<endl;
vector <int> path;
deque <vector <int> > q;
int visited[sunday_traffic_lines], path_last_node;
for(int k = 0; k < sunday_traffic_lines; k++)
{
visited[k] = 0;
}
visited[source] = 1;
path.push_back(source);
q.push_back(path);
while(!q.empty())
{
path = q.front();
q.pop_front();
path_last_node = path[path.size() - 1];
if(path_last_node == destination)
{
cout<<"The Required path is:: \n";
//print_path(path);
for (int i = 0; i < path.size(); i++)
{
printf("%s %d\n", (char *)location_inv[path[i]].c_str(), i);
fprintf(out, "%s %d\n", (char *)location_inv[path[i]].c_str(), i);
}
return;
}
deque <vector <int> >::iterator it = q.begin();
for(int i = 0; i < graph[path_last_node].size(); i++)
{
if(!visited[graph[path_last_node][i]] && find(path.begin(), path.end(), graph[path_last_node][i]) == path.end())
{
vector <int> new_path(path.begin(), path.end());
new_path.push_back(graph[path_last_node][i]);
it = q.insert(it, new_path);
//q.push(new_path);
it++;
visited[graph[path_last_node][i]] = 1;
}
}
}
}
void ucs(int source, int destination)
{
cout<<"UCS : "<<source<<"->"<<destination<<endl;
vector <int> path;
vector <int> cost;
deque <vector <int> > q;
deque <vector <int> > q1;
int visited[sunday_traffic_lines], path_last_node;
for(int k = 0; k < sunday_traffic_lines; k++)
{
visited[k] = 0;
}
visited[source] = 1;
path.push_back(source);
cost.push_back(0);
q.push_back(path);
q1.push_back(cost);
while(!q.empty())
{
path = q.front();
q.pop_front();
cost = q1.front();
q1.pop_front();
path_last_node = path[path.size() - 1];
if(path_last_node == destination)
{
cout<<"The Required path is:: \n";
//print_path(path);
for (int i = 0; i < path.size(); i++)
{
printf("%s %d\n", (char *)location_inv[path[i]].c_str(), cost[i]);
fprintf(out, "%s %d\n", (char *)location_inv[path[i]].c_str(), cost[i]);
}
return;
}/*
else
{
cout<<"[ ";
for(int i=0;i<path.size();++i)
{
cout<<path[i]<<" ";
}
cout<<"]"<<endl;
}*/
//deque <vector <int> >::iterator it = q.begin();
//deque <vector <int> >::iterator it1 = q1.begin();
for(int i = 0; i < graph[path_last_node].size(); i++)
{
deque <vector <int> >::iterator it = q.begin();
deque <vector <int> >::iterator it1 = q1.begin();
vector <int> new_path(path.begin(), path.end());
new_path.push_back(graph[path_last_node][i]);
vector <int> new_cost(cost.begin(), cost.end());
int cost_sum = cost[cost.size() - 1] + travel_time[make_pair(path_last_node, graph[path_last_node][i])];
new_cost.push_back(cost_sum);
//cout<<">>> "<<path_last_node<<" - "<<graph[path_last_node][i]<<endl;
//cout<<cost_sum<<endl;
if(!visited[graph[path_last_node][i]])// && find(path.begin(), path.end(), graph[path_last_node][i]) == path.end())
{
//cout<<"hi "<<cost_sum<<endl;
//vec.begin()+(vec.size()-1)
//cout<<"visited : "<<graph[path_last_node][i]<<endl;
visited[graph[path_last_node][i]] = 1;
if(it1 == q1.end())
{
q.push_back(new_path);
q1.push_back(new_cost);
continue;
}
while(it1 != q1.end() && *((*it1).begin()+(*it1).size() - 1) <= cost_sum)
{
it1++;
it++;
}
/*if(it1 == q1.end())// q1.size() == 1)
{
it1 = q1.begin() + (q1.size() - 1);
it = q.begin() + (q.size() - 1);
}*/
it = q.insert(it, new_path);
it1 = q1.insert(it1, new_cost);
//q.push(new_path);
//it++;
//it1++;
}
else
{
//cout<<"hi123 "<<cost_sum<<endl;
while(it != q.end() && graph[path_last_node][i] != *((*it).begin()+(*it).size() - 1))
{
it++;
it1++;
}
if(it != q.end() && cost_sum < *((*it1).begin()+(*it1).size() - 1))
{
it = q.erase(it);
it1 = q1.erase(it1);
it = q.insert(it, new_path);
it1 = q1.insert(it1, new_cost);
}
}
}
}
}
void a_star(int source, int destination)
{
cout<<"A* : "<<source<<"->"<<destination<<endl;
vector <int> path;
vector <int> cost;
deque <vector <int> > q;
deque <vector <int> > q1;
int visited[sunday_traffic_lines], path_last_node;
for(int k = 0; k < sunday_traffic_lines; k++)
{
visited[k] = 0;
}
visited[source] = 1;
path.push_back(source);
cost.push_back(0);
q.push_back(path);
q1.push_back(cost);
while(!q.empty())
{
path = q.front();
q.pop_front();
cost = q1.front();
q1.pop_front();
path_last_node = path[path.size() - 1];
if(path_last_node == destination)
{
cout<<"The Required path is:: \n";
//print_path(path);
for (int i = 0; i < path.size(); i++)
{
printf("%s %d\n", (char *)location_inv[path[i]].c_str(), cost[i]);
fprintf(out, "%s %d\n", (char *)location_inv[path[i]].c_str(), cost[i]);
}
return;
}
else
{
cout<<"[ ";
for(int i=0;i<path.size();++i)
{
cout<<path[i]<<" ";
}
cout<<"]"<<endl;
}
vector <int> next_node_list = graph[path_last_node];
//cout<<"hi "<<next_node_list[0]<<endl;
int i;
for(i = 0; i < next_node_list.size(); i++)
{
if(!visited[next_node_list[i]])
{
break;
}
}
int next_cost_min_value = sunday_traffic_time[next_node_list[i]], next_cost_min_index = next_node_list[i];
for(i = i + 1; i < next_node_list.size(); i++)
{
//printf("in loop : node = %d h = %d \n", next_node_list[i], sunday_traffic_time[next_node_list[i]]);
if(!visited[next_node_list[i]] && next_cost_min_value > sunday_traffic_time[next_node_list[i]])
{
next_cost_min_value = sunday_traffic_time[next_node_list[i]];
next_cost_min_index = next_node_list[i];
}
}
//cout<<"hi123 "<<next_cost_min_value<<" "<<next_cost_min_index<<endl;
vector <int> new_path(path.begin(), path.end());
new_path.push_back(next_cost_min_index);
vector <int> new_cost(cost.begin(), cost.end());
new_cost.push_back(cost[cost.size() - 1] + travel_time[make_pair(path_last_node, next_cost_min_index)]);
q.push_back(new_path);
q1.push_back(new_cost);
visited[next_cost_min_index] = 1;
}
}
| [
"akshay.gb28@gmail.com"
] | akshay.gb28@gmail.com |
c762b4852b311a08d0491b17a332787444416701 | 2ec289dc0e3151708e9f50a41a13ca0e1c363998 | /Codeforces/Hello 2019/B.cpp | e5fc16eeaee5ef46f065da9026dc17c4e3a72d8a | [] | no_license | sayedgkm/ProgrammingContest | eb71cae6850dd7fac12f49895bfabd58f2f4c70e | 8f3c07e9ebee3b8a662cb5ce0a7c3d53d6f8c72a | refs/heads/master | 2021-04-30T08:54:26.830730 | 2020-07-05T17:03:57 | 2020-07-05T17:03:57 | 121,387,092 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,929 | cpp | ///Bismillahir-Rahmanir-Rahim
#include <bits/stdc++.h>
#define ll long long int
#define FOR(x,y,z) for(int x=y;x<z;x++)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a) memset(a,-1,sizeof(a))
#define N 1000010
#define M 1000000007
#define pi acos(-1.0)
#define ff first
#define ss second
#define pb push_back
#define inf (1e9)+1000
#define eps 1e-9
#define ALL(x) x.begin(),x.end()
using namespace std;
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,1,-1};
template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);}
template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);}
template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));}
template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;}
template <typename T> string NumberToString ( T Number ) { ostringstream ss; ss << Number; return ss.str(); }
inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;}
inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;}
inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;}
template <class T> inline T bigmod(T p,T e,T m){T ret = 1;
for(; e > 0; e >>= 1){
if(e & 1) ret = (ret * p) % m;p = (p * p) % m;
} return (T)ret;}
#ifdef sayed
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1){
cerr << name << " is " << arg1 << std::endl;
}
template < typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names+1, ',');
cerr.write(names, comma - names) << " is " << arg1 <<" | ";
__f(comma+1, args...);
}
#else
#define debug(...)
#endif
///******************************************START******************************************
int ar[N];
int n;
int get(int deg) {
deg%=360;
if(deg<0) deg+=360;
return deg;
}
int go(int pos,int deg) {
if(pos==n) {
return deg==0;
}
int f= 0;
f = f|go(pos+1,get(deg+ar[pos]));
f = f|go(pos+1,get(deg-ar[pos]));
return f;
}
int main(){
#ifdef sayed
//freopen("out.txt","w",stdout);
// freopen("in.txt","r",stdin);
#endif
//ios_base::sync_with_stdio(false);
//cin.tie(0);
n = nxt();
for(int i = 0;i<n;i++) {
ar[i] = nxt();
}
puts(go(0,0)?"YES":"NO");
return 0;
}
| [
"sayedgkm@gmail.com"
] | sayedgkm@gmail.com |
8dd77d64b3f4da68d6607b8ea99a623f49495134 | fec81bfe0453c5646e00c5d69874a71c579a103d | /blazetest/src/mathtest/operations/dvecdvecinner/V6aVHa.cpp | b9db31b26e3e5a7bd0ccf5d4dce7f339a0c9bf54 | [
"BSD-3-Clause"
] | permissive | parsa/blaze | 801b0f619a53f8c07454b80d0a665ac0a3cf561d | 6ce2d5d8951e9b367aad87cc55ac835b054b5964 | refs/heads/master | 2022-09-19T15:46:44.108364 | 2022-07-30T04:47:03 | 2022-07-30T04:47:03 | 105,918,096 | 52 | 7 | null | null | null | null | UTF-8 | C++ | false | false | 3,762 | cpp | //=================================================================================================
/*!
// \file src/mathtest/operations/dvecdvecinner/V6aVHa.cpp
// \brief Source file for the V6aVHa dense vector/dense vector inner product math test
//
// Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <cstdlib>
#include <iostream>
#include <blaze/math/HybridVector.h>
#include <blaze/math/StaticVector.h>
#include <blazetest/mathtest/Creator.h>
#include <blazetest/mathtest/operations/dvecdvecinner/OperationTest.h>
#include <blazetest/system/MathTest.h>
#ifdef BLAZE_USE_HPX_THREADS
# include <hpx/hpx_main.hpp>
#endif
//=================================================================================================
//
// MAIN FUNCTION
//
//=================================================================================================
//*************************************************************************************************
int main()
{
std::cout << " Running 'V6aVHa'..." << std::endl;
using blazetest::mathtest::TypeA;
try
{
// Vector type definitions
using V6a = blaze::StaticVector<TypeA,6UL>;
using VHa = blaze::HybridVector<TypeA,6UL>;
// Creator type definitions
using CV6a = blazetest::Creator<V6a>;
using CVHa = blazetest::Creator<VHa>;
// Running the tests
RUN_DVECDVECINNER_OPERATION_TEST( CV6a(), CVHa( 6UL ) );
}
catch( std::exception& ex ) {
std::cerr << "\n\n ERROR DETECTED during dense vector/dense vector inner product:\n"
<< ex.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//*************************************************************************************************
| [
"klaus.iglberger@gmail.com"
] | klaus.iglberger@gmail.com |
f1463c7bb2bb64bad135208f520a8016f65ad205 | bb61c41e7935c664157fe5331ebb68033da8c093 | /solve/srf/BFS/1697 숨바꼭질.cpp | 13b192c505edbb7c7532e6707b3c08014e06f937 | [] | no_license | jh280722/online-judge | 760cd5835006e9b5e700c8d7b492e9ced4bb27dc | 8397f948bf64c2bd9782a27b70e3d54ed0d40733 | refs/heads/master | 2020-06-13T09:28:34.317392 | 2020-04-02T08:45:24 | 2020-04-02T08:45:24 | 194,613,839 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 926 | cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct DATA {
int x, y;
};
const int MAX = 100001;
const int INF = 2147400000;
bool visit[MAX];
int dr[] = { -1, 0, 1, 0 };
int dc[] = { 0, 1, 0, -1 };
int t;
int n, m, p, k, l, ans, cnt;
queue<int> q;
void bfs() {
while (!q.empty()) {
int qs = q.size();
while (qs--) {
int x = q.front();
q.pop();
if (x == k)
return;
int nx = x + 1;
if (nx > MAX) continue;
if (visit[nx] == false) {
visit[nx] = true;
q.push(nx);
}
nx = x - 1;
if (nx < 0) continue;
if (visit[nx] == false) {
visit[nx] = true;
q.push(nx);
}
nx = 2 * x;
if (nx > MAX) continue;
if (visit[nx] == false) {
visit[nx] = true;
q.push(nx);
}
}
cnt++;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n >> k;
q.push(n);
bfs();
cout << cnt << '\n';
return 0;
} | [
"jh280722@naver.com"
] | jh280722@naver.com |
52930eda22f44f12e45ccfbbfdebaec48619d5c5 | 3f97ace5a580237d2fd3486aa1cfef6d3221dc42 | /app/src/main/cpp/include/opencv2/core/hal/intrin_sse.hpp | 9a8ea4b2449e1de5479c84d5dd2e643507397a6e | [] | no_license | xkkjiayou/WearGlass_1.0 | d56a5417ee2cb62e9fbcee08438c855b5a3a431b | aaf272bc6851165cba8a08cac74746685813145f | refs/heads/master | 2020-04-09T07:10:00.873961 | 2018-12-06T09:45:30 | 2018-12-06T09:45:38 | 160,143,106 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 116,570 | hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_HAL_SSE_HPP
#define OPENCV_HAL_SSE_HPP
#include <algorithm>
#include "opencv2/core/utility.hpp"
#define CV_SIMD128 1
#define CV_SIMD128_64F 1
#define CV_SIMD128_FP16 0 // no native operations with FP16 type.
namespace cv {
//! @cond IGNORED
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
///////// Types ////////////
struct v_uint8x16 {
typedef uchar lane_type;
typedef __m128i vector_type;
enum {
nlanes = 16
};
v_uint8x16() : val(_mm_setzero_si128()) {}
explicit v_uint8x16(__m128i v) : val(v) {}
v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7,
uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14,
uchar v15) {
val = _mm_setr_epi8((char) v0, (char) v1, (char) v2, (char) v3,
(char) v4, (char) v5, (char) v6, (char) v7,
(char) v8, (char) v9, (char) v10, (char) v11,
(char) v12, (char) v13, (char) v14, (char) v15);
}
uchar get0() const {
return (uchar) _mm_cvtsi128_si32(val);
}
__m128i val;
};
struct v_int8x16 {
typedef schar lane_type;
typedef __m128i vector_type;
enum {
nlanes = 16
};
v_int8x16() : val(_mm_setzero_si128()) {}
explicit v_int8x16(__m128i v) : val(v) {}
v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7,
schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14,
schar v15) {
val = _mm_setr_epi8((char) v0, (char) v1, (char) v2, (char) v3,
(char) v4, (char) v5, (char) v6, (char) v7,
(char) v8, (char) v9, (char) v10, (char) v11,
(char) v12, (char) v13, (char) v14, (char) v15);
}
schar get0() const {
return (schar) _mm_cvtsi128_si32(val);
}
__m128i val;
};
struct v_uint16x8 {
typedef ushort lane_type;
typedef __m128i vector_type;
enum {
nlanes = 8
};
v_uint16x8() : val(_mm_setzero_si128()) {}
explicit v_uint16x8(__m128i v) : val(v) {}
v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6,
ushort v7) {
val = _mm_setr_epi16((short) v0, (short) v1, (short) v2, (short) v3,
(short) v4, (short) v5, (short) v6, (short) v7);
}
ushort get0() const {
return (ushort) _mm_cvtsi128_si32(val);
}
__m128i val;
};
struct v_int16x8 {
typedef short lane_type;
typedef __m128i vector_type;
enum {
nlanes = 8
};
v_int16x8() : val(_mm_setzero_si128()) {}
explicit v_int16x8(__m128i v) : val(v) {}
v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7) {
val = _mm_setr_epi16((short) v0, (short) v1, (short) v2, (short) v3,
(short) v4, (short) v5, (short) v6, (short) v7);
}
short get0() const {
return (short) _mm_cvtsi128_si32(val);
}
__m128i val;
};
struct v_uint32x4 {
typedef unsigned lane_type;
typedef __m128i vector_type;
enum {
nlanes = 4
};
v_uint32x4() : val(_mm_setzero_si128()) {}
explicit v_uint32x4(__m128i v) : val(v) {}
v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3) {
val = _mm_setr_epi32((int) v0, (int) v1, (int) v2, (int) v3);
}
unsigned get0() const {
return (unsigned) _mm_cvtsi128_si32(val);
}
__m128i val;
};
struct v_int32x4 {
typedef int lane_type;
typedef __m128i vector_type;
enum {
nlanes = 4
};
v_int32x4() : val(_mm_setzero_si128()) {}
explicit v_int32x4(__m128i v) : val(v) {}
v_int32x4(int v0, int v1, int v2, int v3) {
val = _mm_setr_epi32(v0, v1, v2, v3);
}
int get0() const {
return _mm_cvtsi128_si32(val);
}
__m128i val;
};
struct v_float32x4 {
typedef float lane_type;
typedef __m128 vector_type;
enum {
nlanes = 4
};
v_float32x4() : val(_mm_setzero_ps()) {}
explicit v_float32x4(__m128 v) : val(v) {}
v_float32x4(float v0, float v1, float v2, float v3) {
val = _mm_setr_ps(v0, v1, v2, v3);
}
float get0() const {
return _mm_cvtss_f32(val);
}
__m128 val;
};
struct v_uint64x2 {
typedef uint64 lane_type;
typedef __m128i vector_type;
enum {
nlanes = 2
};
v_uint64x2() : val(_mm_setzero_si128()) {}
explicit v_uint64x2(__m128i v) : val(v) {}
v_uint64x2(uint64 v0, uint64 v1) {
val = _mm_setr_epi32((int) v0, (int) (v0 >> 32), (int) v1, (int) (v1 >> 32));
}
uint64 get0() const {
int a = _mm_cvtsi128_si32(val);
int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32));
return (unsigned) a | ((uint64) (unsigned) b << 32);
}
__m128i val;
};
struct v_int64x2 {
typedef int64 lane_type;
typedef __m128i vector_type;
enum {
nlanes = 2
};
v_int64x2() : val(_mm_setzero_si128()) {}
explicit v_int64x2(__m128i v) : val(v) {}
v_int64x2(int64 v0, int64 v1) {
val = _mm_setr_epi32((int) v0, (int) (v0 >> 32), (int) v1, (int) (v1 >> 32));
}
int64 get0() const {
int a = _mm_cvtsi128_si32(val);
int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32));
return (int64) ((unsigned) a | ((uint64) (unsigned) b << 32));
}
__m128i val;
};
struct v_float64x2 {
typedef double lane_type;
typedef __m128d vector_type;
enum {
nlanes = 2
};
v_float64x2() : val(_mm_setzero_pd()) {}
explicit v_float64x2(__m128d v) : val(v) {}
v_float64x2(double v0, double v1) {
val = _mm_setr_pd(v0, v1);
}
double get0() const {
return _mm_cvtsd_f64(val);
}
__m128d val;
};
namespace hal_sse_internal {
template<typename to_sse_type, typename from_sse_type>
to_sse_type v_sse_reinterpret_as(const from_sse_type &val);
#define OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(to_sse_type, from_sse_type, sse_cast_intrin) \
template<> inline \
to_sse_type v_sse_reinterpret_as(const from_sse_type& a) \
{ return sse_cast_intrin(a); }
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128i, __m128i, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128i, __m128, _mm_castps_si128)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128i, __m128d, _mm_castpd_si128)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128, __m128i, _mm_castsi128_ps)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128, __m128, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128, __m128d, _mm_castpd_ps)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128d, __m128i, _mm_castsi128_pd)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128d, __m128, _mm_castps_pd)
OPENCV_HAL_IMPL_SSE_REINTERPRET_RAW(__m128d, __m128d, OPENCV_HAL_NOP)
}
#define OPENCV_HAL_IMPL_SSE_INITVEC(_Tpvec, _Tp, suffix, zsuffix, ssuffix, _Tps, cast) \
inline _Tpvec v_setzero_##suffix() { return _Tpvec(_mm_setzero_##zsuffix()); } \
inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(_mm_set1_##ssuffix((_Tps)v)); } \
template<typename _Tpvec0> inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0& a) \
{ return _Tpvec(cast(a.val)); }
OPENCV_HAL_IMPL_SSE_INITVEC(v_uint8x16, uchar, u8, si128, epi8, char, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_INITVEC(v_int8x16, schar, s8, si128, epi8, char, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_INITVEC(v_uint16x8, ushort, u16, si128, epi16, short, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_INITVEC(v_int16x8, short, s16, si128, epi16, short, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_INITVEC(v_uint32x4, unsigned, u32, si128, epi32, int, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_INITVEC(v_int32x4, int, s32, si128, epi32, int, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_INITVEC(v_float32x4, float, f32, ps, ps, float, _mm_castsi128_ps)
OPENCV_HAL_IMPL_SSE_INITVEC(v_float64x2, double, f64, pd, pd, double, _mm_castsi128_pd)
inline v_uint64x2 v_setzero_u64() { return v_uint64x2(_mm_setzero_si128()); }
inline v_int64x2 v_setzero_s64() { return v_int64x2(_mm_setzero_si128()); }
inline v_uint64x2 v_setall_u64(uint64 val) { return v_uint64x2(val, val); }
inline v_int64x2 v_setall_s64(int64 val) { return v_int64x2(val, val); }
template<typename _Tpvec>
inline
v_uint64x2 v_reinterpret_as_u64(const _Tpvec &a) { return v_uint64x2(a.val); }
template<typename _Tpvec>
inline
v_int64x2 v_reinterpret_as_s64(const _Tpvec &a) { return v_int64x2(a.val); }
inline v_float32x4 v_reinterpret_as_f32(const v_uint64x2 &a) {
return v_float32x4(_mm_castsi128_ps(a.val));
}
inline v_float32x4 v_reinterpret_as_f32(const v_int64x2 &a) {
return v_float32x4(_mm_castsi128_ps(a.val));
}
inline v_float64x2 v_reinterpret_as_f64(const v_uint64x2 &a) {
return v_float64x2(_mm_castsi128_pd(a.val));
}
inline v_float64x2 v_reinterpret_as_f64(const v_int64x2 &a) {
return v_float64x2(_mm_castsi128_pd(a.val));
}
#define OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(_Tpvec, suffix) \
inline _Tpvec v_reinterpret_as_##suffix(const v_float32x4& a) \
{ return _Tpvec(_mm_castps_si128(a.val)); } \
inline _Tpvec v_reinterpret_as_##suffix(const v_float64x2& a) \
{ return _Tpvec(_mm_castpd_si128(a.val)); }
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint8x16, u8)
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int8x16, s8)
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint16x8, u16)
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int16x8, s16)
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint32x4, u32)
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int32x4, s32)
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint64x2, u64)
OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int64x2, s64)
inline v_float32x4 v_reinterpret_as_f32(const v_float32x4 &a) { return a; }
inline v_float64x2 v_reinterpret_as_f64(const v_float64x2 &a) { return a; }
inline v_float32x4 v_reinterpret_as_f32(const v_float64x2 &a) {
return v_float32x4(_mm_castpd_ps(a.val));
}
inline v_float64x2 v_reinterpret_as_f64(const v_float32x4 &a) {
return v_float64x2(_mm_castps_pd(a.val));
}
//////////////// PACK ///////////////
inline v_uint8x16 v_pack(const v_uint16x8 &a, const v_uint16x8 &b) {
__m128i delta = _mm_set1_epi16(255);
return v_uint8x16(_mm_packus_epi16(_mm_subs_epu16(a.val, _mm_subs_epu16(a.val, delta)),
_mm_subs_epu16(b.val, _mm_subs_epu16(b.val, delta))));
}
inline void v_pack_store(uchar *ptr, const v_uint16x8 &a) {
__m128i delta = _mm_set1_epi16(255);
__m128i a1 = _mm_subs_epu16(a.val, _mm_subs_epu16(a.val, delta));
_mm_storel_epi64((__m128i *) ptr, _mm_packus_epi16(a1, a1));
}
inline v_uint8x16 v_pack_u(const v_int16x8 &a, const v_int16x8 &b) {
return v_uint8x16(_mm_packus_epi16(a.val, b.val));
}
inline void v_pack_u_store(uchar *ptr, const v_int16x8 &a) {
_mm_storel_epi64((__m128i *) ptr, _mm_packus_epi16(a.val, a.val));
}
template<int n>
inline
v_uint8x16 v_rshr_pack(const v_uint16x8 &a, const v_uint16x8 &b) {
// we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.
__m128i delta = _mm_set1_epi16((short) (1 << (n - 1)));
return v_uint8x16(_mm_packus_epi16(_mm_srli_epi16(_mm_adds_epu16(a.val, delta), n),
_mm_srli_epi16(_mm_adds_epu16(b.val, delta), n)));
}
template<int n>
inline
void v_rshr_pack_store(uchar *ptr, const v_uint16x8 &a) {
__m128i delta = _mm_set1_epi16((short) (1 << (n - 1)));
__m128i a1 = _mm_srli_epi16(_mm_adds_epu16(a.val, delta), n);
_mm_storel_epi64((__m128i *) ptr, _mm_packus_epi16(a1, a1));
}
template<int n>
inline
v_uint8x16 v_rshr_pack_u(const v_int16x8 &a, const v_int16x8 &b) {
__m128i delta = _mm_set1_epi16((short) (1 << (n - 1)));
return v_uint8x16(_mm_packus_epi16(_mm_srai_epi16(_mm_adds_epi16(a.val, delta), n),
_mm_srai_epi16(_mm_adds_epi16(b.val, delta), n)));
}
template<int n>
inline
void v_rshr_pack_u_store(uchar *ptr, const v_int16x8 &a) {
__m128i delta = _mm_set1_epi16((short) (1 << (n - 1)));
__m128i a1 = _mm_srai_epi16(_mm_adds_epi16(a.val, delta), n);
_mm_storel_epi64((__m128i *) ptr, _mm_packus_epi16(a1, a1));
}
inline v_int8x16 v_pack(const v_int16x8 &a, const v_int16x8 &b) {
return v_int8x16(_mm_packs_epi16(a.val, b.val));
}
inline void v_pack_store(schar *ptr, const v_int16x8 &a) {
_mm_storel_epi64((__m128i *) ptr, _mm_packs_epi16(a.val, a.val));
}
template<int n>
inline
v_int8x16 v_rshr_pack(const v_int16x8 &a, const v_int16x8 &b) {
// we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.
__m128i delta = _mm_set1_epi16((short) (1 << (n - 1)));
return v_int8x16(_mm_packs_epi16(_mm_srai_epi16(_mm_adds_epi16(a.val, delta), n),
_mm_srai_epi16(_mm_adds_epi16(b.val, delta), n)));
}
template<int n>
inline
void v_rshr_pack_store(schar *ptr, const v_int16x8 &a) {
// we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers.
__m128i delta = _mm_set1_epi16((short) (1 << (n - 1)));
__m128i a1 = _mm_srai_epi16(_mm_adds_epi16(a.val, delta), n);
_mm_storel_epi64((__m128i *) ptr, _mm_packs_epi16(a1, a1));
}
// byte-wise "mask ? a : b"
inline __m128i v_select_si128(__m128i mask, __m128i a, __m128i b) {
#if CV_SSE4_1
return _mm_blendv_epi8(b, a, mask);
#else
return _mm_xor_si128(b, _mm_and_si128(_mm_xor_si128(a, b), mask));
#endif
}
inline v_uint16x8 v_pack(const v_uint32x4 &a, const v_uint32x4 &b) {
return v_uint16x8(_v128_packs_epu32(a.val, b.val));
}
inline void v_pack_store(ushort *ptr, const v_uint32x4 &a) {
__m128i z = _mm_setzero_si128(), maxval32 = _mm_set1_epi32(65535), delta32 = _mm_set1_epi32(
32768);
__m128i a1 = _mm_sub_epi32(v_select_si128(_mm_cmpgt_epi32(z, a.val), maxval32, a.val),
delta32);
__m128i r = _mm_packs_epi32(a1, a1);
_mm_storel_epi64((__m128i *) ptr, _mm_sub_epi16(r, _mm_set1_epi16(-32768)));
}
template<int n>
inline
v_uint16x8 v_rshr_pack(const v_uint32x4 &a, const v_uint32x4 &b) {
__m128i delta = _mm_set1_epi32(1 << (n - 1)), delta32 = _mm_set1_epi32(32768);
__m128i a1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(a.val, delta), n), delta32);
__m128i b1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(b.val, delta), n), delta32);
return v_uint16x8(_mm_sub_epi16(_mm_packs_epi32(a1, b1), _mm_set1_epi16(-32768)));
}
template<int n>
inline
void v_rshr_pack_store(ushort *ptr, const v_uint32x4 &a) {
__m128i delta = _mm_set1_epi32(1 << (n - 1)), delta32 = _mm_set1_epi32(32768);
__m128i a1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(a.val, delta), n), delta32);
__m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));
_mm_storel_epi64((__m128i *) ptr, a2);
}
inline v_uint16x8 v_pack_u(const v_int32x4 &a, const v_int32x4 &b) {
#if CV_SSE4_1
return v_uint16x8(_mm_packus_epi32(a.val, b.val));
#else
__m128i delta32 = _mm_set1_epi32(32768);
// preliminary saturate negative values to zero
__m128i a1 = _mm_and_si128(a.val, _mm_cmpgt_epi32(a.val, _mm_set1_epi32(0)));
__m128i b1 = _mm_and_si128(b.val, _mm_cmpgt_epi32(b.val, _mm_set1_epi32(0)));
__m128i r = _mm_packs_epi32(_mm_sub_epi32(a1, delta32), _mm_sub_epi32(b1, delta32));
return v_uint16x8(_mm_sub_epi16(r, _mm_set1_epi16(-32768)));
#endif
}
inline void v_pack_u_store(ushort *ptr, const v_int32x4 &a) {
#if CV_SSE4_1
_mm_storel_epi64((__m128i*)ptr, _mm_packus_epi32(a.val, a.val));
#else
__m128i delta32 = _mm_set1_epi32(32768);
__m128i a1 = _mm_sub_epi32(a.val, delta32);
__m128i r = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));
_mm_storel_epi64((__m128i *) ptr, r);
#endif
}
template<int n>
inline
v_uint16x8 v_rshr_pack_u(const v_int32x4 &a, const v_int32x4 &b) {
#if CV_SSE4_1
__m128i delta = _mm_set1_epi32(1 << (n - 1));
return v_uint16x8(_mm_packus_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n),
_mm_srai_epi32(_mm_add_epi32(b.val, delta), n)));
#else
__m128i delta = _mm_set1_epi32(1 << (n - 1)), delta32 = _mm_set1_epi32(32768);
__m128i a1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n), delta32);
__m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));
__m128i b1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(b.val, delta), n), delta32);
__m128i b2 = _mm_sub_epi16(_mm_packs_epi32(b1, b1), _mm_set1_epi16(-32768));
return v_uint16x8(_mm_unpacklo_epi64(a2, b2));
#endif
}
template<int n>
inline
void v_rshr_pack_u_store(ushort *ptr, const v_int32x4 &a) {
#if CV_SSE4_1
__m128i delta = _mm_set1_epi32(1 << (n - 1));
__m128i a1 = _mm_srai_epi32(_mm_add_epi32(a.val, delta), n);
_mm_storel_epi64((__m128i*)ptr, _mm_packus_epi32(a1, a1));
#else
__m128i delta = _mm_set1_epi32(1 << (n - 1)), delta32 = _mm_set1_epi32(32768);
__m128i a1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n), delta32);
__m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768));
_mm_storel_epi64((__m128i *) ptr, a2);
#endif
}
inline v_int16x8 v_pack(const v_int32x4 &a, const v_int32x4 &b) {
return v_int16x8(_mm_packs_epi32(a.val, b.val));
}
inline void v_pack_store(short *ptr, const v_int32x4 &a) {
_mm_storel_epi64((__m128i *) ptr, _mm_packs_epi32(a.val, a.val));
}
template<int n>
inline
v_int16x8 v_rshr_pack(const v_int32x4 &a, const v_int32x4 &b) {
__m128i delta = _mm_set1_epi32(1 << (n - 1));
return v_int16x8(_mm_packs_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n),
_mm_srai_epi32(_mm_add_epi32(b.val, delta), n)));
}
template<int n>
inline
void v_rshr_pack_store(short *ptr, const v_int32x4 &a) {
__m128i delta = _mm_set1_epi32(1 << (n - 1));
__m128i a1 = _mm_srai_epi32(_mm_add_epi32(a.val, delta), n);
_mm_storel_epi64((__m128i *) ptr, _mm_packs_epi32(a1, a1));
}
// [a0 0 | b0 0] [a1 0 | b1 0]
inline v_uint32x4 v_pack(const v_uint64x2 &a, const v_uint64x2 &b) {
__m128i v0 = _mm_unpacklo_epi32(a.val, b.val); // a0 a1 0 0
__m128i v1 = _mm_unpackhi_epi32(a.val, b.val); // b0 b1 0 0
return v_uint32x4(_mm_unpacklo_epi32(v0, v1));
}
inline void v_pack_store(unsigned *ptr, const v_uint64x2 &a) {
__m128i a1 = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 2, 2, 0));
_mm_storel_epi64((__m128i *) ptr, a1);
}
// [a0 0 | b0 0] [a1 0 | b1 0]
inline v_int32x4 v_pack(const v_int64x2 &a, const v_int64x2 &b) {
__m128i v0 = _mm_unpacklo_epi32(a.val, b.val); // a0 a1 0 0
__m128i v1 = _mm_unpackhi_epi32(a.val, b.val); // b0 b1 0 0
return v_int32x4(_mm_unpacklo_epi32(v0, v1));
}
inline void v_pack_store(int *ptr, const v_int64x2 &a) {
__m128i a1 = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 2, 2, 0));
_mm_storel_epi64((__m128i *) ptr, a1);
}
template<int n>
inline
v_uint32x4 v_rshr_pack(const v_uint64x2 &a, const v_uint64x2 &b) {
uint64 delta = (uint64) 1 << (n - 1);
v_uint64x2 delta2(delta, delta);
__m128i a1 = _mm_srli_epi64(_mm_add_epi64(a.val, delta2.val), n);
__m128i b1 = _mm_srli_epi64(_mm_add_epi64(b.val, delta2.val), n);
__m128i v0 = _mm_unpacklo_epi32(a1, b1); // a0 a1 0 0
__m128i v1 = _mm_unpackhi_epi32(a1, b1); // b0 b1 0 0
return v_uint32x4(_mm_unpacklo_epi32(v0, v1));
}
template<int n>
inline
void v_rshr_pack_store(unsigned *ptr, const v_uint64x2 &a) {
uint64 delta = (uint64) 1 << (n - 1);
v_uint64x2 delta2(delta, delta);
__m128i a1 = _mm_srli_epi64(_mm_add_epi64(a.val, delta2.val), n);
__m128i a2 = _mm_shuffle_epi32(a1, _MM_SHUFFLE(0, 2, 2, 0));
_mm_storel_epi64((__m128i *) ptr, a2);
}
inline __m128i v_sign_epi64(__m128i a) {
return _mm_shuffle_epi32(_mm_srai_epi32(a, 31), _MM_SHUFFLE(3, 3, 1, 1)); // x m0 | x m1
}
inline __m128i v_srai_epi64(__m128i a, int imm) {
__m128i smask = v_sign_epi64(a);
return _mm_xor_si128(_mm_srli_epi64(_mm_xor_si128(a, smask), imm), smask);
}
template<int n>
inline
v_int32x4 v_rshr_pack(const v_int64x2 &a, const v_int64x2 &b) {
int64 delta = (int64) 1 << (n - 1);
v_int64x2 delta2(delta, delta);
__m128i a1 = v_srai_epi64(_mm_add_epi64(a.val, delta2.val), n);
__m128i b1 = v_srai_epi64(_mm_add_epi64(b.val, delta2.val), n);
__m128i v0 = _mm_unpacklo_epi32(a1, b1); // a0 a1 0 0
__m128i v1 = _mm_unpackhi_epi32(a1, b1); // b0 b1 0 0
return v_int32x4(_mm_unpacklo_epi32(v0, v1));
}
template<int n>
inline
void v_rshr_pack_store(int *ptr, const v_int64x2 &a) {
int64 delta = (int64) 1 << (n - 1);
v_int64x2 delta2(delta, delta);
__m128i a1 = v_srai_epi64(_mm_add_epi64(a.val, delta2.val), n);
__m128i a2 = _mm_shuffle_epi32(a1, _MM_SHUFFLE(0, 2, 2, 0));
_mm_storel_epi64((__m128i *) ptr, a2);
}
// pack boolean
inline v_uint8x16 v_pack_b(const v_uint16x8 &a, const v_uint16x8 &b) {
__m128i ab = _mm_packs_epi16(a.val, b.val);
return v_uint8x16(ab);
}
inline v_uint8x16 v_pack_b(const v_uint32x4 &a, const v_uint32x4 &b,
const v_uint32x4 &c, const v_uint32x4 &d) {
__m128i ab = _mm_packs_epi32(a.val, b.val);
__m128i cd = _mm_packs_epi32(c.val, d.val);
return v_uint8x16(_mm_packs_epi16(ab, cd));
}
inline v_uint8x16 v_pack_b(const v_uint64x2 &a, const v_uint64x2 &b, const v_uint64x2 &c,
const v_uint64x2 &d, const v_uint64x2 &e, const v_uint64x2 &f,
const v_uint64x2 &g, const v_uint64x2 &h) {
__m128i ab = _mm_packs_epi32(a.val, b.val);
__m128i cd = _mm_packs_epi32(c.val, d.val);
__m128i ef = _mm_packs_epi32(e.val, f.val);
__m128i gh = _mm_packs_epi32(g.val, h.val);
__m128i abcd = _mm_packs_epi32(ab, cd);
__m128i efgh = _mm_packs_epi32(ef, gh);
return v_uint8x16(_mm_packs_epi16(abcd, efgh));
}
inline v_float32x4 v_matmul(const v_float32x4 &v, const v_float32x4 &m0,
const v_float32x4 &m1, const v_float32x4 &m2,
const v_float32x4 &m3) {
__m128 v0 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(0, 0, 0, 0)), m0.val);
__m128 v1 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(1, 1, 1, 1)), m1.val);
__m128 v2 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(2, 2, 2, 2)), m2.val);
__m128 v3 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(3, 3, 3, 3)), m3.val);
return v_float32x4(_mm_add_ps(_mm_add_ps(v0, v1), _mm_add_ps(v2, v3)));
}
inline v_float32x4 v_matmuladd(const v_float32x4 &v, const v_float32x4 &m0,
const v_float32x4 &m1, const v_float32x4 &m2,
const v_float32x4 &a) {
__m128 v0 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(0, 0, 0, 0)), m0.val);
__m128 v1 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(1, 1, 1, 1)), m1.val);
__m128 v2 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(2, 2, 2, 2)), m2.val);
return v_float32x4(_mm_add_ps(_mm_add_ps(v0, v1), _mm_add_ps(v2, a.val)));
}
#define OPENCV_HAL_IMPL_SSE_BIN_OP(bin_op, _Tpvec, intrin) \
inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \
{ \
return _Tpvec(intrin(a.val, b.val)); \
} \
inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \
{ \
a.val = intrin(a.val, b.val); \
return a; \
}
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint8x16, _mm_adds_epu8)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint8x16, _mm_subs_epu8)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int8x16, _mm_adds_epi8)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int8x16, _mm_subs_epi8)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint16x8, _mm_adds_epu16)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint16x8, _mm_subs_epu16)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int16x8, _mm_adds_epi16)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int16x8, _mm_subs_epi16)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint32x4, _mm_add_epi32)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint32x4, _mm_sub_epi32)
OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_uint32x4, _v128_mullo_epi32)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int32x4, _mm_add_epi32)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int32x4, _mm_sub_epi32)
OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_int32x4, _v128_mullo_epi32)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_float32x4, _mm_add_ps)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_float32x4, _mm_sub_ps)
OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_float32x4, _mm_mul_ps)
OPENCV_HAL_IMPL_SSE_BIN_OP(/, v_float32x4, _mm_div_ps)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_float64x2, _mm_add_pd)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_float64x2, _mm_sub_pd)
OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_float64x2, _mm_mul_pd)
OPENCV_HAL_IMPL_SSE_BIN_OP(/, v_float64x2, _mm_div_pd)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint64x2, _mm_add_epi64)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint64x2, _mm_sub_epi64)
OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int64x2, _mm_add_epi64)
OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int64x2, _mm_sub_epi64)
// saturating multiply 8-bit, 16-bit
#define OPENCV_HAL_IMPL_SSE_MUL_SAT(_Tpvec, _Tpwvec) \
inline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b) \
{ \
_Tpwvec c, d; \
v_mul_expand(a, b, c, d); \
return v_pack(c, d); \
} \
inline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b) \
{ a = a * b; return a; }
OPENCV_HAL_IMPL_SSE_MUL_SAT(v_uint8x16, v_uint16x8)
OPENCV_HAL_IMPL_SSE_MUL_SAT(v_int8x16, v_int16x8)
OPENCV_HAL_IMPL_SSE_MUL_SAT(v_uint16x8, v_uint32x4)
OPENCV_HAL_IMPL_SSE_MUL_SAT(v_int16x8, v_int32x4)
// Multiply and expand
inline void v_mul_expand(const v_uint8x16 &a, const v_uint8x16 &b,
v_uint16x8 &c, v_uint16x8 &d) {
v_uint16x8 a0, a1, b0, b1;
v_expand(a, a0, a1);
v_expand(b, b0, b1);
c = v_mul_wrap(a0, b0);
d = v_mul_wrap(a1, b1);
}
inline void v_mul_expand(const v_int8x16 &a, const v_int8x16 &b,
v_int16x8 &c, v_int16x8 &d) {
v_int16x8 a0, a1, b0, b1;
v_expand(a, a0, a1);
v_expand(b, b0, b1);
c = v_mul_wrap(a0, b0);
d = v_mul_wrap(a1, b1);
}
inline void v_mul_expand(const v_int16x8 &a, const v_int16x8 &b,
v_int32x4 &c, v_int32x4 &d) {
__m128i v0 = _mm_mullo_epi16(a.val, b.val);
__m128i v1 = _mm_mulhi_epi16(a.val, b.val);
c.val = _mm_unpacklo_epi16(v0, v1);
d.val = _mm_unpackhi_epi16(v0, v1);
}
inline void v_mul_expand(const v_uint16x8 &a, const v_uint16x8 &b,
v_uint32x4 &c, v_uint32x4 &d) {
__m128i v0 = _mm_mullo_epi16(a.val, b.val);
__m128i v1 = _mm_mulhi_epu16(a.val, b.val);
c.val = _mm_unpacklo_epi16(v0, v1);
d.val = _mm_unpackhi_epi16(v0, v1);
}
inline void v_mul_expand(const v_uint32x4 &a, const v_uint32x4 &b,
v_uint64x2 &c, v_uint64x2 &d) {
__m128i c0 = _mm_mul_epu32(a.val, b.val);
__m128i c1 = _mm_mul_epu32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32));
c.val = _mm_unpacklo_epi64(c0, c1);
d.val = _mm_unpackhi_epi64(c0, c1);
}
inline v_int16x8 v_mul_hi(const v_int16x8 &a, const v_int16x8 &b) {
return v_int16x8(_mm_mulhi_epi16(a.val, b.val));
}
inline v_uint16x8 v_mul_hi(const v_uint16x8 &a, const v_uint16x8 &b) {
return v_uint16x8(_mm_mulhi_epu16(a.val, b.val));
}
inline v_int32x4 v_dotprod(const v_int16x8 &a, const v_int16x8 &b) {
return v_int32x4(_mm_madd_epi16(a.val, b.val));
}
inline v_int32x4 v_dotprod(const v_int16x8 &a, const v_int16x8 &b, const v_int32x4 &c) {
return v_int32x4(_mm_add_epi32(_mm_madd_epi16(a.val, b.val), c.val));
}
#define OPENCV_HAL_IMPL_SSE_LOGIC_OP(_Tpvec, suffix, not_const) \
OPENCV_HAL_IMPL_SSE_BIN_OP(&, _Tpvec, _mm_and_##suffix) \
OPENCV_HAL_IMPL_SSE_BIN_OP(|, _Tpvec, _mm_or_##suffix) \
OPENCV_HAL_IMPL_SSE_BIN_OP(^, _Tpvec, _mm_xor_##suffix) \
inline _Tpvec operator ~ (const _Tpvec& a) \
{ \
return _Tpvec(_mm_xor_##suffix(a.val, not_const)); \
}
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint8x16, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int8x16, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint16x8, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int16x8, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint32x4, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int32x4, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint64x2, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int64x2, si128, _mm_set1_epi32(-1))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_float32x4, ps, _mm_castsi128_ps(_mm_set1_epi32(-1)))
OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_float64x2, pd, _mm_castsi128_pd(_mm_set1_epi32(-1)))
inline v_float32x4 v_sqrt(const v_float32x4 &x) { return v_float32x4(_mm_sqrt_ps(x.val)); }
inline v_float32x4 v_invsqrt(const v_float32x4 &x) {
const __m128 _0_5 = _mm_set1_ps(0.5f), _1_5 = _mm_set1_ps(1.5f);
__m128 t = x.val;
__m128 h = _mm_mul_ps(t, _0_5);
t = _mm_rsqrt_ps(t);
t = _mm_mul_ps(t, _mm_sub_ps(_1_5, _mm_mul_ps(_mm_mul_ps(t, t), h)));
return v_float32x4(t);
}
inline v_float64x2 v_sqrt(const v_float64x2 &x) { return v_float64x2(_mm_sqrt_pd(x.val)); }
inline v_float64x2 v_invsqrt(const v_float64x2 &x) {
const __m128d v_1 = _mm_set1_pd(1.);
return v_float64x2(_mm_div_pd(v_1, _mm_sqrt_pd(x.val)));
}
#define OPENCV_HAL_IMPL_SSE_ABS_INT_FUNC(_Tpuvec, _Tpsvec, func, suffix, subWidth) \
inline _Tpuvec v_abs(const _Tpsvec& x) \
{ return _Tpuvec(_mm_##func##_ep##suffix(x.val, _mm_sub_ep##subWidth(_mm_setzero_si128(), x.val))); }
OPENCV_HAL_IMPL_SSE_ABS_INT_FUNC(v_uint8x16, v_int8x16, min, u8, i8)
OPENCV_HAL_IMPL_SSE_ABS_INT_FUNC(v_uint16x8, v_int16x8, max, i16, i16)
inline v_uint32x4 v_abs(const v_int32x4 &x) {
__m128i s = _mm_srli_epi32(x.val, 31);
__m128i f = _mm_srai_epi32(x.val, 31);
return v_uint32x4(_mm_add_epi32(_mm_xor_si128(x.val, f), s));
}
inline v_float32x4 v_abs(const v_float32x4 &x) {
return v_float32x4(_mm_and_ps(x.val, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))));
}
inline v_float64x2 v_abs(const v_float64x2 &x) {
return v_float64x2(_mm_and_pd(x.val,
_mm_castsi128_pd(_mm_srli_epi64(_mm_set1_epi32(-1), 1))));
}
// TODO: exp, log, sin, cos
#define OPENCV_HAL_IMPL_SSE_BIN_FUNC(_Tpvec, func, intrin) \
inline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \
{ \
return _Tpvec(intrin(a.val, b.val)); \
}
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_min, _mm_min_epu8)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_max, _mm_max_epu8)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_min, _mm_min_epi16)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_max, _mm_max_epi16)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float32x4, v_min, _mm_min_ps)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float32x4, v_max, _mm_max_ps)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float64x2, v_min, _mm_min_pd)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float64x2, v_max, _mm_max_pd)
inline v_int8x16 v_min(const v_int8x16 &a, const v_int8x16 &b) {
#if CV_SSE4_1
return v_int8x16(_mm_min_epi8(a.val, b.val));
#else
__m128i delta = _mm_set1_epi8((char) -128);
return v_int8x16(_mm_xor_si128(delta, _mm_min_epu8(_mm_xor_si128(a.val, delta),
_mm_xor_si128(b.val, delta))));
#endif
}
inline v_int8x16 v_max(const v_int8x16 &a, const v_int8x16 &b) {
#if CV_SSE4_1
return v_int8x16(_mm_max_epi8(a.val, b.val));
#else
__m128i delta = _mm_set1_epi8((char) -128);
return v_int8x16(_mm_xor_si128(delta, _mm_max_epu8(_mm_xor_si128(a.val, delta),
_mm_xor_si128(b.val, delta))));
#endif
}
inline v_uint16x8 v_min(const v_uint16x8 &a, const v_uint16x8 &b) {
#if CV_SSE4_1
return v_uint16x8(_mm_min_epu16(a.val, b.val));
#else
return v_uint16x8(_mm_subs_epu16(a.val, _mm_subs_epu16(a.val, b.val)));
#endif
}
inline v_uint16x8 v_max(const v_uint16x8 &a, const v_uint16x8 &b) {
#if CV_SSE4_1
return v_uint16x8(_mm_max_epu16(a.val, b.val));
#else
return v_uint16x8(_mm_adds_epu16(_mm_subs_epu16(a.val, b.val), b.val));
#endif
}
inline v_uint32x4 v_min(const v_uint32x4 &a, const v_uint32x4 &b) {
#if CV_SSE4_1
return v_uint32x4(_mm_min_epu32(a.val, b.val));
#else
__m128i delta = _mm_set1_epi32((int) 0x80000000);
__m128i mask = _mm_cmpgt_epi32(_mm_xor_si128(a.val, delta), _mm_xor_si128(b.val, delta));
return v_uint32x4(v_select_si128(mask, b.val, a.val));
#endif
}
inline v_uint32x4 v_max(const v_uint32x4 &a, const v_uint32x4 &b) {
#if CV_SSE4_1
return v_uint32x4(_mm_max_epu32(a.val, b.val));
#else
__m128i delta = _mm_set1_epi32((int) 0x80000000);
__m128i mask = _mm_cmpgt_epi32(_mm_xor_si128(a.val, delta), _mm_xor_si128(b.val, delta));
return v_uint32x4(v_select_si128(mask, a.val, b.val));
#endif
}
inline v_int32x4 v_min(const v_int32x4 &a, const v_int32x4 &b) {
#if CV_SSE4_1
return v_int32x4(_mm_min_epi32(a.val, b.val));
#else
return v_int32x4(v_select_si128(_mm_cmpgt_epi32(a.val, b.val), b.val, a.val));
#endif
}
inline v_int32x4 v_max(const v_int32x4 &a, const v_int32x4 &b) {
#if CV_SSE4_1
return v_int32x4(_mm_max_epi32(a.val, b.val));
#else
return v_int32x4(v_select_si128(_mm_cmpgt_epi32(a.val, b.val), a.val, b.val));
#endif
}
#define OPENCV_HAL_IMPL_SSE_INT_CMP_OP(_Tpuvec, _Tpsvec, suffix, sbit) \
inline _Tpuvec operator == (const _Tpuvec& a, const _Tpuvec& b) \
{ return _Tpuvec(_mm_cmpeq_##suffix(a.val, b.val)); } \
inline _Tpuvec operator != (const _Tpuvec& a, const _Tpuvec& b) \
{ \
__m128i not_mask = _mm_set1_epi32(-1); \
return _Tpuvec(_mm_xor_si128(_mm_cmpeq_##suffix(a.val, b.val), not_mask)); \
} \
inline _Tpsvec operator == (const _Tpsvec& a, const _Tpsvec& b) \
{ return _Tpsvec(_mm_cmpeq_##suffix(a.val, b.val)); } \
inline _Tpsvec operator != (const _Tpsvec& a, const _Tpsvec& b) \
{ \
__m128i not_mask = _mm_set1_epi32(-1); \
return _Tpsvec(_mm_xor_si128(_mm_cmpeq_##suffix(a.val, b.val), not_mask)); \
} \
inline _Tpuvec operator < (const _Tpuvec& a, const _Tpuvec& b) \
{ \
__m128i smask = _mm_set1_##suffix(sbit); \
return _Tpuvec(_mm_cmpgt_##suffix(_mm_xor_si128(b.val, smask), _mm_xor_si128(a.val, smask))); \
} \
inline _Tpuvec operator > (const _Tpuvec& a, const _Tpuvec& b) \
{ \
__m128i smask = _mm_set1_##suffix(sbit); \
return _Tpuvec(_mm_cmpgt_##suffix(_mm_xor_si128(a.val, smask), _mm_xor_si128(b.val, smask))); \
} \
inline _Tpuvec operator <= (const _Tpuvec& a, const _Tpuvec& b) \
{ \
__m128i smask = _mm_set1_##suffix(sbit); \
__m128i not_mask = _mm_set1_epi32(-1); \
__m128i res = _mm_cmpgt_##suffix(_mm_xor_si128(a.val, smask), _mm_xor_si128(b.val, smask)); \
return _Tpuvec(_mm_xor_si128(res, not_mask)); \
} \
inline _Tpuvec operator >= (const _Tpuvec& a, const _Tpuvec& b) \
{ \
__m128i smask = _mm_set1_##suffix(sbit); \
__m128i not_mask = _mm_set1_epi32(-1); \
__m128i res = _mm_cmpgt_##suffix(_mm_xor_si128(b.val, smask), _mm_xor_si128(a.val, smask)); \
return _Tpuvec(_mm_xor_si128(res, not_mask)); \
} \
inline _Tpsvec operator < (const _Tpsvec& a, const _Tpsvec& b) \
{ \
return _Tpsvec(_mm_cmpgt_##suffix(b.val, a.val)); \
} \
inline _Tpsvec operator > (const _Tpsvec& a, const _Tpsvec& b) \
{ \
return _Tpsvec(_mm_cmpgt_##suffix(a.val, b.val)); \
} \
inline _Tpsvec operator <= (const _Tpsvec& a, const _Tpsvec& b) \
{ \
__m128i not_mask = _mm_set1_epi32(-1); \
return _Tpsvec(_mm_xor_si128(_mm_cmpgt_##suffix(a.val, b.val), not_mask)); \
} \
inline _Tpsvec operator >= (const _Tpsvec& a, const _Tpsvec& b) \
{ \
__m128i not_mask = _mm_set1_epi32(-1); \
return _Tpsvec(_mm_xor_si128(_mm_cmpgt_##suffix(b.val, a.val), not_mask)); \
}
OPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint8x16, v_int8x16, epi8, (char) -128)
OPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint16x8, v_int16x8, epi16, (short) -32768)
OPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint32x4, v_int32x4, epi32, (int) 0x80000000)
#define OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(_Tpvec, suffix) \
inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \
{ return _Tpvec(_mm_cmpeq_##suffix(a.val, b.val)); } \
inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \
{ return _Tpvec(_mm_cmpneq_##suffix(a.val, b.val)); } \
inline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \
{ return _Tpvec(_mm_cmplt_##suffix(a.val, b.val)); } \
inline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \
{ return _Tpvec(_mm_cmpgt_##suffix(a.val, b.val)); } \
inline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \
{ return _Tpvec(_mm_cmple_##suffix(a.val, b.val)); } \
inline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \
{ return _Tpvec(_mm_cmpge_##suffix(a.val, b.val)); }
OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float32x4, ps)
OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float64x2, pd)
#define OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(_Tpvec, cast) \
inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \
{ return cast(v_reinterpret_as_f64(a) == v_reinterpret_as_f64(b)); } \
inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \
{ return cast(v_reinterpret_as_f64(a) != v_reinterpret_as_f64(b)); }
OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_uint64x2, v_reinterpret_as_u64)
OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_int64x2, v_reinterpret_as_s64)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_add_wrap, _mm_add_epi8)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int8x16, v_add_wrap, _mm_add_epi8)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_add_wrap, _mm_add_epi16)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_add_wrap, _mm_add_epi16)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_sub_wrap, _mm_sub_epi8)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int8x16, v_sub_wrap, _mm_sub_epi8)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_sub_wrap, _mm_sub_epi16)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_sub_wrap, _mm_sub_epi16)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_mul_wrap, _mm_mullo_epi16)
OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_mul_wrap, _mm_mullo_epi16)
inline v_uint8x16 v_mul_wrap(const v_uint8x16 &a, const v_uint8x16 &b) {
__m128i ad = _mm_srai_epi16(a.val, 8);
__m128i bd = _mm_srai_epi16(b.val, 8);
__m128i p0 = _mm_mullo_epi16(a.val, b.val); // even
__m128i p1 = _mm_slli_epi16(_mm_mullo_epi16(ad, bd), 8); // odd
const __m128i b01 = _mm_set1_epi32(0xFF00FF00);
return v_uint8x16(_v128_blendv_epi8(p0, p1, b01));
}
inline v_int8x16 v_mul_wrap(const v_int8x16 &a, const v_int8x16 &b) {
return v_reinterpret_as_s8(v_mul_wrap(v_reinterpret_as_u8(a), v_reinterpret_as_u8(b)));
}
/** Absolute difference **/
inline v_uint8x16 v_absdiff(const v_uint8x16 &a, const v_uint8x16 &b) {
return v_add_wrap(a - b, b - a);
}
inline v_uint16x8 v_absdiff(const v_uint16x8 &a, const v_uint16x8 &b) {
return v_add_wrap(a - b, b - a);
}
inline v_uint32x4 v_absdiff(const v_uint32x4 &a, const v_uint32x4 &b) {
return v_max(a, b) - v_min(a, b);
}
inline v_uint8x16 v_absdiff(const v_int8x16 &a, const v_int8x16 &b) {
v_int8x16 d = v_sub_wrap(a, b);
v_int8x16 m = a < b;
return v_reinterpret_as_u8(v_sub_wrap(d ^ m, m));
}
inline v_uint16x8 v_absdiff(const v_int16x8 &a, const v_int16x8 &b) {
return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b)));
}
inline v_uint32x4 v_absdiff(const v_int32x4 &a, const v_int32x4 &b) {
v_int32x4 d = a - b;
v_int32x4 m = a < b;
return v_reinterpret_as_u32((d ^ m) - m);
}
/** Saturating absolute difference **/
inline v_int8x16 v_absdiffs(const v_int8x16 &a, const v_int8x16 &b) {
v_int8x16 d = a - b;
v_int8x16 m = a < b;
return (d ^ m) - m;
}
inline v_int16x8 v_absdiffs(const v_int16x8 &a, const v_int16x8 &b) {
return v_max(a, b) - v_min(a, b);
}
inline v_int32x4 v_fma(const v_int32x4 &a, const v_int32x4 &b, const v_int32x4 &c) {
return a * b + c;
}
inline v_int32x4 v_muladd(const v_int32x4 &a, const v_int32x4 &b, const v_int32x4 &c) {
return v_fma(a, b, c);
}
inline v_float32x4 v_fma(const v_float32x4 &a, const v_float32x4 &b, const v_float32x4 &c) {
#if CV_FMA3
return v_float32x4(_mm_fmadd_ps(a.val, b.val, c.val));
#else
return v_float32x4(_mm_add_ps(_mm_mul_ps(a.val, b.val), c.val));
#endif
}
inline v_float64x2 v_fma(const v_float64x2 &a, const v_float64x2 &b, const v_float64x2 &c) {
#if CV_FMA3
return v_float64x2(_mm_fmadd_pd(a.val, b.val, c.val));
#else
return v_float64x2(_mm_add_pd(_mm_mul_pd(a.val, b.val), c.val));
#endif
}
#define OPENCV_HAL_IMPL_SSE_MISC_FLT_OP(_Tpvec, _Tp, _Tpreg, suffix, absmask_vec) \
inline _Tpvec v_absdiff(const _Tpvec& a, const _Tpvec& b) \
{ \
_Tpreg absmask = _mm_castsi128_##suffix(absmask_vec); \
return _Tpvec(_mm_and_##suffix(_mm_sub_##suffix(a.val, b.val), absmask)); \
} \
inline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b) \
{ \
_Tpvec res = v_fma(a, a, b*b); \
return _Tpvec(_mm_sqrt_##suffix(res.val)); \
} \
inline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b) \
{ \
return v_fma(a, a, b*b); \
} \
inline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \
{ \
return v_fma(a, b, c); \
}
OPENCV_HAL_IMPL_SSE_MISC_FLT_OP(v_float32x4, float, __m128, ps,
_mm_set1_epi32((int) 0x7fffffff))
OPENCV_HAL_IMPL_SSE_MISC_FLT_OP(v_float64x2, double, __m128d, pd,
_mm_srli_epi64(_mm_set1_epi32(-1), 1))
#define OPENCV_HAL_IMPL_SSE_SHIFT_OP(_Tpuvec, _Tpsvec, suffix, srai) \
inline _Tpuvec operator << (const _Tpuvec& a, int imm) \
{ \
return _Tpuvec(_mm_slli_##suffix(a.val, imm)); \
} \
inline _Tpsvec operator << (const _Tpsvec& a, int imm) \
{ \
return _Tpsvec(_mm_slli_##suffix(a.val, imm)); \
} \
inline _Tpuvec operator >> (const _Tpuvec& a, int imm) \
{ \
return _Tpuvec(_mm_srli_##suffix(a.val, imm)); \
} \
inline _Tpsvec operator >> (const _Tpsvec& a, int imm) \
{ \
return _Tpsvec(srai(a.val, imm)); \
} \
template<int imm> \
inline _Tpuvec v_shl(const _Tpuvec& a) \
{ \
return _Tpuvec(_mm_slli_##suffix(a.val, imm)); \
} \
template<int imm> \
inline _Tpsvec v_shl(const _Tpsvec& a) \
{ \
return _Tpsvec(_mm_slli_##suffix(a.val, imm)); \
} \
template<int imm> \
inline _Tpuvec v_shr(const _Tpuvec& a) \
{ \
return _Tpuvec(_mm_srli_##suffix(a.val, imm)); \
} \
template<int imm> \
inline _Tpsvec v_shr(const _Tpsvec& a) \
{ \
return _Tpsvec(srai(a.val, imm)); \
}
OPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint16x8, v_int16x8, epi16, _mm_srai_epi16)
OPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint32x4, v_int32x4, epi32, _mm_srai_epi32)
OPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint64x2, v_int64x2, epi64, v_srai_epi64)
namespace hal_sse_internal {
template<int imm,
bool is_invalid = ((imm < 0) || (imm > 16)),
bool is_first = (imm == 0),
bool is_half = (imm == 8),
bool is_second = (imm == 16),
bool is_other = (((imm > 0) && (imm < 8)) || ((imm > 8) && (imm < 16)))>
class v_sse_palignr_u8_class;
template<int imm>
class v_sse_palignr_u8_class<imm, true, false, false, false, false>;
template<int imm>
class v_sse_palignr_u8_class<imm, false, true, false, false, false> {
public:
inline __m128i operator()(const __m128i &a, const __m128i &) const {
return a;
}
};
template<int imm>
class v_sse_palignr_u8_class<imm, false, false, true, false, false> {
public:
inline __m128i operator()(const __m128i &a, const __m128i &b) const {
return _mm_unpacklo_epi64(_mm_unpackhi_epi64(a, a), b);
}
};
template<int imm>
class v_sse_palignr_u8_class<imm, false, false, false, true, false> {
public:
inline __m128i operator()(const __m128i &, const __m128i &b) const {
return b;
}
};
template<int imm>
class v_sse_palignr_u8_class<imm, false, false, false, false, true> {
#if CV_SSSE3
public:
inline __m128i operator()(const __m128i& a, const __m128i& b) const
{
return _mm_alignr_epi8(b, a, imm);
}
#else
public:
inline __m128i operator()(const __m128i &a, const __m128i &b) const {
enum {
imm2 = (sizeof(__m128i) - imm)
};
return _mm_or_si128(_mm_srli_si128(a, imm), _mm_slli_si128(b, imm2));
}
#endif
};
template<int imm>
inline __m128i v_sse_palignr_u8(const __m128i &a, const __m128i &b) {
CV_StaticAssert((imm >= 0) && (imm <= 16), "Invalid imm for v_sse_palignr_u8.");
return v_sse_palignr_u8_class<imm>()(a, b);
}
}
template<int imm, typename _Tpvec>
inline _Tpvec v_rotate_right(const _Tpvec &a) {
using namespace hal_sse_internal;
enum {
imm2 = (imm * sizeof(typename _Tpvec::lane_type))
};
return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(
_mm_srli_si128(
v_sse_reinterpret_as<__m128i>(a.val), imm2)));
}
template<int imm, typename _Tpvec>
inline _Tpvec v_rotate_left(const _Tpvec &a) {
using namespace hal_sse_internal;
enum {
imm2 = (imm * sizeof(typename _Tpvec::lane_type))
};
return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(
_mm_slli_si128(
v_sse_reinterpret_as<__m128i>(a.val), imm2)));
}
template<int imm, typename _Tpvec>
inline _Tpvec v_rotate_right(const _Tpvec &a, const _Tpvec &b) {
using namespace hal_sse_internal;
enum {
imm2 = (imm * sizeof(typename _Tpvec::lane_type))
};
return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(
v_sse_palignr_u8<imm2>(
v_sse_reinterpret_as<__m128i>(a.val),
v_sse_reinterpret_as<__m128i>(b.val))));
}
template<int imm, typename _Tpvec>
inline _Tpvec v_rotate_left(const _Tpvec &a, const _Tpvec &b) {
using namespace hal_sse_internal;
enum {
imm2 = ((_Tpvec::nlanes - imm) * sizeof(typename _Tpvec::lane_type))
};
return _Tpvec(v_sse_reinterpret_as<typename _Tpvec::vector_type>(
v_sse_palignr_u8<imm2>(
v_sse_reinterpret_as<__m128i>(b.val),
v_sse_reinterpret_as<__m128i>(a.val))));
}
#define OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(_Tpvec, _Tp) \
inline _Tpvec v_load(const _Tp* ptr) \
{ return _Tpvec(_mm_loadu_si128((const __m128i*)ptr)); } \
inline _Tpvec v_load_aligned(const _Tp* ptr) \
{ return _Tpvec(_mm_load_si128((const __m128i*)ptr)); } \
inline _Tpvec v_load_low(const _Tp* ptr) \
{ return _Tpvec(_mm_loadl_epi64((const __m128i*)ptr)); } \
inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \
{ \
return _Tpvec(_mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i*)ptr0), \
_mm_loadl_epi64((const __m128i*)ptr1))); \
} \
inline void v_store(_Tp* ptr, const _Tpvec& a) \
{ _mm_storeu_si128((__m128i*)ptr, a.val); } \
inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \
{ _mm_store_si128((__m128i*)ptr, a.val); } \
inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \
{ _mm_stream_si128((__m128i*)ptr, a.val); } \
inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \
{ \
if( mode == hal::STORE_UNALIGNED ) \
_mm_storeu_si128((__m128i*)ptr, a.val); \
else if( mode == hal::STORE_ALIGNED_NOCACHE ) \
_mm_stream_si128((__m128i*)ptr, a.val); \
else \
_mm_store_si128((__m128i*)ptr, a.val); \
} \
inline void v_store_low(_Tp* ptr, const _Tpvec& a) \
{ _mm_storel_epi64((__m128i*)ptr, a.val); } \
inline void v_store_high(_Tp* ptr, const _Tpvec& a) \
{ _mm_storel_epi64((__m128i*)ptr, _mm_unpackhi_epi64(a.val, a.val)); }
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint8x16, uchar)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int8x16, schar)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint16x8, ushort)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int16x8, short)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint32x4, unsigned)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int32x4, int)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint64x2, uint64)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int64x2, int64)
#define OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(_Tpvec, _Tp, suffix) \
inline _Tpvec v_load(const _Tp* ptr) \
{ return _Tpvec(_mm_loadu_##suffix(ptr)); } \
inline _Tpvec v_load_aligned(const _Tp* ptr) \
{ return _Tpvec(_mm_load_##suffix(ptr)); } \
inline _Tpvec v_load_low(const _Tp* ptr) \
{ return _Tpvec(_mm_castsi128_##suffix(_mm_loadl_epi64((const __m128i*)ptr))); } \
inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \
{ \
return _Tpvec(_mm_castsi128_##suffix( \
_mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i*)ptr0), \
_mm_loadl_epi64((const __m128i*)ptr1)))); \
} \
inline void v_store(_Tp* ptr, const _Tpvec& a) \
{ _mm_storeu_##suffix(ptr, a.val); } \
inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \
{ _mm_store_##suffix(ptr, a.val); } \
inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \
{ _mm_stream_##suffix(ptr, a.val); } \
inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \
{ \
if( mode == hal::STORE_UNALIGNED ) \
_mm_storeu_##suffix(ptr, a.val); \
else if( mode == hal::STORE_ALIGNED_NOCACHE ) \
_mm_stream_##suffix(ptr, a.val); \
else \
_mm_store_##suffix(ptr, a.val); \
} \
inline void v_store_low(_Tp* ptr, const _Tpvec& a) \
{ _mm_storel_epi64((__m128i*)ptr, _mm_cast##suffix##_si128(a.val)); } \
inline void v_store_high(_Tp* ptr, const _Tpvec& a) \
{ \
__m128i a1 = _mm_cast##suffix##_si128(a.val); \
_mm_storel_epi64((__m128i*)ptr, _mm_unpackhi_epi64(a1, a1)); \
}
OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float32x4, float, ps)
OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float64x2, double, pd)
#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_8(_Tpvec, scalartype, func, suffix, sbit) \
inline scalartype v_reduce_##func(const v_##_Tpvec& a) \
{ \
__m128i val = a.val; \
val = _mm_##func##_##suffix(val, _mm_srli_si128(val,8)); \
val = _mm_##func##_##suffix(val, _mm_srli_si128(val,4)); \
val = _mm_##func##_##suffix(val, _mm_srli_si128(val,2)); \
return (scalartype)_mm_cvtsi128_si32(val); \
} \
inline unsigned scalartype v_reduce_##func(const v_u##_Tpvec& a) \
{ \
__m128i val = a.val; \
__m128i smask = _mm_set1_epi16(sbit); \
val = _mm_xor_si128(val, smask); \
val = _mm_##func##_##suffix(val, _mm_srli_si128(val,8)); \
val = _mm_##func##_##suffix(val, _mm_srli_si128(val,4)); \
val = _mm_##func##_##suffix(val, _mm_srli_si128(val,2)); \
return (unsigned scalartype)(_mm_cvtsi128_si32(val) ^ sbit); \
}
#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_8_SUM(_Tpvec, scalartype, suffix) \
inline scalartype v_reduce_sum(const v_##_Tpvec& a) \
{ \
__m128i val = a.val; \
val = _mm_adds_epi##suffix(val, _mm_srli_si128(val, 8)); \
val = _mm_adds_epi##suffix(val, _mm_srli_si128(val, 4)); \
val = _mm_adds_epi##suffix(val, _mm_srli_si128(val, 2)); \
return (scalartype)_mm_cvtsi128_si32(val); \
} \
inline unsigned scalartype v_reduce_sum(const v_u##_Tpvec& a) \
{ \
__m128i val = a.val; \
val = _mm_adds_epu##suffix(val, _mm_srli_si128(val, 8)); \
val = _mm_adds_epu##suffix(val, _mm_srli_si128(val, 4)); \
val = _mm_adds_epu##suffix(val, _mm_srli_si128(val, 2)); \
return (unsigned scalartype)_mm_cvtsi128_si32(val); \
}
OPENCV_HAL_IMPL_SSE_REDUCE_OP_8(int16x8, short, max, epi16, (short) -32768)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_8(int16x8, short, min, epi16, (short) -32768)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_8_SUM(int16x8, short, 16)
#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(_Tpvec, scalartype, regtype, suffix, cast_from, cast_to, extract) \
inline scalartype v_reduce_sum(const _Tpvec& a) \
{ \
regtype val = a.val; \
val = _mm_add_##suffix(val, cast_to(_mm_srli_si128(cast_from(val), 8))); \
val = _mm_add_##suffix(val, cast_to(_mm_srli_si128(cast_from(val), 4))); \
return (scalartype)_mm_cvt##extract(val); \
}
#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(_Tpvec, scalartype, func, scalar_func) \
inline scalartype v_reduce_##func(const _Tpvec& a) \
{ \
scalartype CV_DECL_ALIGNED(16) buf[4]; \
v_store_aligned(buf, a); \
scalartype s0 = scalar_func(buf[0], buf[1]); \
scalartype s1 = scalar_func(buf[2], buf[3]); \
return scalar_func(s0, s1); \
}
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_uint32x4, unsigned, __m128i, epi32, OPENCV_HAL_NOP,
OPENCV_HAL_NOP, si128_si32)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_int32x4, int, __m128i, epi32, OPENCV_HAL_NOP,
OPENCV_HAL_NOP, si128_si32)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_float32x4, float, __m128, ps, _mm_castps_si128,
_mm_castsi128_ps, ss_f32)
inline v_float32x4 v_reduce_sum4(const v_float32x4 &a, const v_float32x4 &b,
const v_float32x4 &c, const v_float32x4 &d) {
#if CV_SSE3
__m128 ab = _mm_hadd_ps(a.val, b.val);
__m128 cd = _mm_hadd_ps(c.val, d.val);
return v_float32x4(_mm_hadd_ps(ab, cd));
#else
__m128 ac = _mm_add_ps(_mm_unpacklo_ps(a.val, c.val), _mm_unpackhi_ps(a.val, c.val));
__m128 bd = _mm_add_ps(_mm_unpacklo_ps(b.val, d.val), _mm_unpackhi_ps(b.val, d.val));
return v_float32x4(_mm_add_ps(_mm_unpacklo_ps(ac, bd), _mm_unpackhi_ps(ac, bd)));
#endif
}
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, max, std::max)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, min, std::min)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, max, std::max)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, min, std::min)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, max, std::max)
OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, min, std::min)
#define OPENCV_HAL_IMPL_SSE_POPCOUNT(_Tpvec) \
inline v_uint32x4 v_popcount(const _Tpvec& a) \
{ \
__m128i m1 = _mm_set1_epi32(0x55555555); \
__m128i m2 = _mm_set1_epi32(0x33333333); \
__m128i m4 = _mm_set1_epi32(0x0f0f0f0f); \
__m128i p = a.val; \
p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 1), m1), _mm_and_si128(p, m1)); \
p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 2), m2), _mm_and_si128(p, m2)); \
p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 4), m4), _mm_and_si128(p, m4)); \
p = _mm_adds_epi8(p, _mm_srli_si128(p, 1)); \
p = _mm_adds_epi8(p, _mm_srli_si128(p, 2)); \
return v_uint32x4(_mm_and_si128(p, _mm_set1_epi32(0x000000ff))); \
}
OPENCV_HAL_IMPL_SSE_POPCOUNT(v_uint8x16)
OPENCV_HAL_IMPL_SSE_POPCOUNT(v_uint16x8)
OPENCV_HAL_IMPL_SSE_POPCOUNT(v_uint32x4)
OPENCV_HAL_IMPL_SSE_POPCOUNT(v_int8x16)
OPENCV_HAL_IMPL_SSE_POPCOUNT(v_int16x8)
OPENCV_HAL_IMPL_SSE_POPCOUNT(v_int32x4)
#define OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(_Tpvec, suffix, pack_op, and_op, signmask, allmask) \
inline int v_signmask(const _Tpvec& a) \
{ \
return and_op(_mm_movemask_##suffix(pack_op(a.val)), signmask); \
} \
inline bool v_check_all(const _Tpvec& a) \
{ return and_op(_mm_movemask_##suffix(a.val), allmask) == allmask; } \
inline bool v_check_any(const _Tpvec& a) \
{ return and_op(_mm_movemask_##suffix(a.val), allmask) != 0; }
#define OPENCV_HAL_PACKS(a) _mm_packs_epi16(a, a)
inline __m128i v_packq_epi32(__m128i a) {
__m128i b = _mm_packs_epi32(a, a);
return _mm_packs_epi16(b, b);
}
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 65535, 65535)
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 65535, 65535)
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint16x8, epi8, OPENCV_HAL_PACKS, OPENCV_HAL_AND, 255,
(int) 0xaaaa)
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int16x8, epi8, OPENCV_HAL_PACKS, OPENCV_HAL_AND, 255,
(int) 0xaaaa)
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint32x4, epi8, v_packq_epi32, OPENCV_HAL_AND, 15,
(int) 0x8888)
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int32x4, epi8, v_packq_epi32, OPENCV_HAL_AND, 15,
(int) 0x8888)
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float32x4, ps, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 15, 15)
OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float64x2, pd, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 3, 3)
#if CV_SSE4_1
#define OPENCV_HAL_IMPL_SSE_SELECT(_Tpvec, cast_ret, cast, suffix) \
inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \
{ \
return _Tpvec(cast_ret(_mm_blendv_##suffix(cast(b.val), cast(a.val), cast(mask.val)))); \
}
OPENCV_HAL_IMPL_SSE_SELECT(v_uint8x16, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)
OPENCV_HAL_IMPL_SSE_SELECT(v_int8x16, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)
OPENCV_HAL_IMPL_SSE_SELECT(v_uint16x8, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)
OPENCV_HAL_IMPL_SSE_SELECT(v_int16x8, OPENCV_HAL_NOP, OPENCV_HAL_NOP, epi8)
OPENCV_HAL_IMPL_SSE_SELECT(v_uint32x4, _mm_castps_si128, _mm_castsi128_ps, ps)
OPENCV_HAL_IMPL_SSE_SELECT(v_int32x4, _mm_castps_si128, _mm_castsi128_ps, ps)
// OPENCV_HAL_IMPL_SSE_SELECT(v_uint64x2, TBD, TBD, pd)
// OPENCV_HAL_IMPL_SSE_SELECT(v_int64x2, TBD, TBD, ps)
OPENCV_HAL_IMPL_SSE_SELECT(v_float32x4, OPENCV_HAL_NOP, OPENCV_HAL_NOP, ps)
OPENCV_HAL_IMPL_SSE_SELECT(v_float64x2, OPENCV_HAL_NOP, OPENCV_HAL_NOP, pd)
#else // CV_SSE4_1
#define OPENCV_HAL_IMPL_SSE_SELECT(_Tpvec, suffix) \
inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \
{ \
return _Tpvec(_mm_xor_##suffix(b.val, _mm_and_##suffix(_mm_xor_##suffix(b.val, a.val), mask.val))); \
}
OPENCV_HAL_IMPL_SSE_SELECT(v_uint8x16, si128)
OPENCV_HAL_IMPL_SSE_SELECT(v_int8x16, si128)
OPENCV_HAL_IMPL_SSE_SELECT(v_uint16x8, si128)
OPENCV_HAL_IMPL_SSE_SELECT(v_int16x8, si128)
OPENCV_HAL_IMPL_SSE_SELECT(v_uint32x4, si128)
OPENCV_HAL_IMPL_SSE_SELECT(v_int32x4, si128)
// OPENCV_HAL_IMPL_SSE_SELECT(v_uint64x2, si128)
// OPENCV_HAL_IMPL_SSE_SELECT(v_int64x2, si128)
OPENCV_HAL_IMPL_SSE_SELECT(v_float32x4, ps)
OPENCV_HAL_IMPL_SSE_SELECT(v_float64x2, pd)
#endif
/* Expand */
#define OPENCV_HAL_IMPL_SSE_EXPAND(_Tpvec, _Tpwvec, _Tp, intrin) \
inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \
{ \
b0.val = intrin(a.val); \
b1.val = __CV_CAT(intrin, _high)(a.val); \
} \
inline _Tpwvec v_expand_low(const _Tpvec& a) \
{ return _Tpwvec(intrin(a.val)); } \
inline _Tpwvec v_expand_high(const _Tpvec& a) \
{ return _Tpwvec(__CV_CAT(intrin, _high)(a.val)); } \
inline _Tpwvec v_load_expand(const _Tp* ptr) \
{ \
__m128i a = _mm_loadl_epi64((const __m128i*)ptr); \
return _Tpwvec(intrin(a)); \
}
OPENCV_HAL_IMPL_SSE_EXPAND(v_uint8x16, v_uint16x8, uchar, _v128_cvtepu8_epi16)
OPENCV_HAL_IMPL_SSE_EXPAND(v_int8x16, v_int16x8, schar, _v128_cvtepi8_epi16)
OPENCV_HAL_IMPL_SSE_EXPAND(v_uint16x8, v_uint32x4, ushort, _v128_cvtepu16_epi32)
OPENCV_HAL_IMPL_SSE_EXPAND(v_int16x8, v_int32x4, short, _v128_cvtepi16_epi32)
OPENCV_HAL_IMPL_SSE_EXPAND(v_uint32x4, v_uint64x2, unsigned, _v128_cvtepu32_epi64)
OPENCV_HAL_IMPL_SSE_EXPAND(v_int32x4, v_int64x2, int, _v128_cvtepi32_epi64)
#define OPENCV_HAL_IMPL_SSE_EXPAND_Q(_Tpvec, _Tp, intrin) \
inline _Tpvec v_load_expand_q(const _Tp* ptr) \
{ \
__m128i a = _mm_cvtsi32_si128(*(const int*)ptr); \
return _Tpvec(intrin(a)); \
}
OPENCV_HAL_IMPL_SSE_EXPAND_Q(v_uint32x4, uchar, _v128_cvtepu8_epi32)
OPENCV_HAL_IMPL_SSE_EXPAND_Q(v_int32x4, schar, _v128_cvtepi8_epi32)
#define OPENCV_HAL_IMPL_SSE_UNPACKS(_Tpvec, suffix, cast_from, cast_to) \
inline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1) \
{ \
b0.val = _mm_unpacklo_##suffix(a0.val, a1.val); \
b1.val = _mm_unpackhi_##suffix(a0.val, a1.val); \
} \
inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \
{ \
__m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \
return _Tpvec(cast_to(_mm_unpacklo_epi64(a1, b1))); \
} \
inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \
{ \
__m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \
return _Tpvec(cast_to(_mm_unpackhi_epi64(a1, b1))); \
} \
inline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d) \
{ \
__m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \
c.val = cast_to(_mm_unpacklo_epi64(a1, b1)); \
d.val = cast_to(_mm_unpackhi_epi64(a1, b1)); \
}
OPENCV_HAL_IMPL_SSE_UNPACKS(v_uint8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_UNPACKS(v_int8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_UNPACKS(v_uint16x8, epi16, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_UNPACKS(v_int16x8, epi16, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_UNPACKS(v_uint32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_UNPACKS(v_int32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_UNPACKS(v_float32x4, ps, _mm_castps_si128, _mm_castsi128_ps)
OPENCV_HAL_IMPL_SSE_UNPACKS(v_float64x2, pd, _mm_castpd_si128, _mm_castsi128_pd)
template<int s, typename _Tpvec>
inline _Tpvec v_extract(const _Tpvec &a, const _Tpvec &b) {
return v_rotate_right<s>(a, b);
}
inline v_int32x4 v_round(const v_float32x4 &a) { return v_int32x4(_mm_cvtps_epi32(a.val)); }
inline v_int32x4 v_floor(const v_float32x4 &a) {
__m128i a1 = _mm_cvtps_epi32(a.val);
__m128i mask = _mm_castps_si128(_mm_cmpgt_ps(_mm_cvtepi32_ps(a1), a.val));
return v_int32x4(_mm_add_epi32(a1, mask));
}
inline v_int32x4 v_ceil(const v_float32x4 &a) {
__m128i a1 = _mm_cvtps_epi32(a.val);
__m128i mask = _mm_castps_si128(_mm_cmpgt_ps(a.val, _mm_cvtepi32_ps(a1)));
return v_int32x4(_mm_sub_epi32(a1, mask));
}
inline v_int32x4 v_trunc(const v_float32x4 &a) { return v_int32x4(_mm_cvttps_epi32(a.val)); }
inline v_int32x4 v_round(const v_float64x2 &a) { return v_int32x4(_mm_cvtpd_epi32(a.val)); }
inline v_int32x4 v_round(const v_float64x2 &a, const v_float64x2 &b) {
__m128i ai = _mm_cvtpd_epi32(a.val), bi = _mm_cvtpd_epi32(b.val);
return v_int32x4(_mm_unpacklo_epi64(ai, bi));
}
inline v_int32x4 v_floor(const v_float64x2 &a) {
__m128i a1 = _mm_cvtpd_epi32(a.val);
__m128i mask = _mm_castpd_si128(_mm_cmpgt_pd(_mm_cvtepi32_pd(a1), a.val));
mask = _mm_srli_si128(_mm_slli_si128(mask, 4), 8); // m0 m0 m1 m1 => m0 m1 0 0
return v_int32x4(_mm_add_epi32(a1, mask));
}
inline v_int32x4 v_ceil(const v_float64x2 &a) {
__m128i a1 = _mm_cvtpd_epi32(a.val);
__m128i mask = _mm_castpd_si128(_mm_cmpgt_pd(a.val, _mm_cvtepi32_pd(a1)));
mask = _mm_srli_si128(_mm_slli_si128(mask, 4), 8); // m0 m0 m1 m1 => m0 m1 0 0
return v_int32x4(_mm_sub_epi32(a1, mask));
}
inline v_int32x4 v_trunc(const v_float64x2 &a) { return v_int32x4(_mm_cvttpd_epi32(a.val)); }
#define OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(_Tpvec, suffix, cast_from, cast_to) \
inline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \
const _Tpvec& a2, const _Tpvec& a3, \
_Tpvec& b0, _Tpvec& b1, \
_Tpvec& b2, _Tpvec& b3) \
{ \
__m128i t0 = cast_from(_mm_unpacklo_##suffix(a0.val, a1.val)); \
__m128i t1 = cast_from(_mm_unpacklo_##suffix(a2.val, a3.val)); \
__m128i t2 = cast_from(_mm_unpackhi_##suffix(a0.val, a1.val)); \
__m128i t3 = cast_from(_mm_unpackhi_##suffix(a2.val, a3.val)); \
\
b0.val = cast_to(_mm_unpacklo_epi64(t0, t1)); \
b1.val = cast_to(_mm_unpackhi_epi64(t0, t1)); \
b2.val = cast_to(_mm_unpacklo_epi64(t2, t3)); \
b3.val = cast_to(_mm_unpackhi_epi64(t2, t3)); \
}
OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_uint32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_int32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP)
OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_float32x4, ps, _mm_castps_si128, _mm_castsi128_ps)
// load deinterleave
inline void v_load_deinterleave(const uchar *ptr, v_uint8x16 &a, v_uint8x16 &b) {
__m128i t00 = _mm_loadu_si128((const __m128i *) ptr);
__m128i t01 = _mm_loadu_si128((const __m128i *) (ptr + 16));
__m128i t10 = _mm_unpacklo_epi8(t00, t01);
__m128i t11 = _mm_unpackhi_epi8(t00, t01);
__m128i t20 = _mm_unpacklo_epi8(t10, t11);
__m128i t21 = _mm_unpackhi_epi8(t10, t11);
__m128i t30 = _mm_unpacklo_epi8(t20, t21);
__m128i t31 = _mm_unpackhi_epi8(t20, t21);
a.val = _mm_unpacklo_epi8(t30, t31);
b.val = _mm_unpackhi_epi8(t30, t31);
}
inline void v_load_deinterleave(const uchar *ptr, v_uint8x16 &a, v_uint8x16 &b, v_uint8x16 &c) {
#if CV_SSE4_1
const __m128i m0 = _mm_setr_epi8(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0);
const __m128i m1 = _mm_setr_epi8(0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0);
__m128i s0 = _mm_loadu_si128((const __m128i*)ptr);
__m128i s1 = _mm_loadu_si128((const __m128i*)(ptr + 16));
__m128i s2 = _mm_loadu_si128((const __m128i*)(ptr + 32));
__m128i a0 = _mm_blendv_epi8(_mm_blendv_epi8(s0, s1, m0), s2, m1);
__m128i b0 = _mm_blendv_epi8(_mm_blendv_epi8(s1, s2, m0), s0, m1);
__m128i c0 = _mm_blendv_epi8(_mm_blendv_epi8(s2, s0, m0), s1, m1);
const __m128i sh_b = _mm_setr_epi8(0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14, 1, 4, 7, 10, 13);
const __m128i sh_g = _mm_setr_epi8(1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 5, 8, 11, 14);
const __m128i sh_r = _mm_setr_epi8(2, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15);
a0 = _mm_shuffle_epi8(a0, sh_b);
b0 = _mm_shuffle_epi8(b0, sh_g);
c0 = _mm_shuffle_epi8(c0, sh_r);
a.val = a0;
b.val = b0;
c.val = c0;
#elif CV_SSSE3
const __m128i m0 = _mm_setr_epi8(0, 3, 6, 9, 12, 15, 1, 4, 7, 10, 13, 2, 5, 8, 11, 14);
const __m128i m1 = _mm_alignr_epi8(m0, m0, 11);
const __m128i m2 = _mm_alignr_epi8(m0, m0, 6);
__m128i t0 = _mm_loadu_si128((const __m128i*)ptr);
__m128i t1 = _mm_loadu_si128((const __m128i*)(ptr + 16));
__m128i t2 = _mm_loadu_si128((const __m128i*)(ptr + 32));
__m128i s0 = _mm_shuffle_epi8(t0, m0);
__m128i s1 = _mm_shuffle_epi8(t1, m1);
__m128i s2 = _mm_shuffle_epi8(t2, m2);
t0 = _mm_alignr_epi8(s1, _mm_slli_si128(s0, 10), 5);
a.val = _mm_alignr_epi8(s2, t0, 5);
t1 = _mm_alignr_epi8(_mm_srli_si128(s1, 5), _mm_slli_si128(s0, 5), 6);
b.val = _mm_alignr_epi8(_mm_srli_si128(s2, 5), t1, 5);
t2 = _mm_alignr_epi8(_mm_srli_si128(s2, 10), s1, 11);
c.val = _mm_alignr_epi8(t2, s0, 11);
#else
__m128i t00 = _mm_loadu_si128((const __m128i *) ptr);
__m128i t01 = _mm_loadu_si128((const __m128i *) (ptr + 16));
__m128i t02 = _mm_loadu_si128((const __m128i *) (ptr + 32));
__m128i t10 = _mm_unpacklo_epi8(t00, _mm_unpackhi_epi64(t01, t01));
__m128i t11 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t00, t00), t02);
__m128i t12 = _mm_unpacklo_epi8(t01, _mm_unpackhi_epi64(t02, t02));
__m128i t20 = _mm_unpacklo_epi8(t10, _mm_unpackhi_epi64(t11, t11));
__m128i t21 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t10, t10), t12);
__m128i t22 = _mm_unpacklo_epi8(t11, _mm_unpackhi_epi64(t12, t12));
__m128i t30 = _mm_unpacklo_epi8(t20, _mm_unpackhi_epi64(t21, t21));
__m128i t31 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t20, t20), t22);
__m128i t32 = _mm_unpacklo_epi8(t21, _mm_unpackhi_epi64(t22, t22));
a.val = _mm_unpacklo_epi8(t30, _mm_unpackhi_epi64(t31, t31));
b.val = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t30, t30), t32);
c.val = _mm_unpacklo_epi8(t31, _mm_unpackhi_epi64(t32, t32));
#endif
}
inline void v_load_deinterleave(const uchar *ptr, v_uint8x16 &a, v_uint8x16 &b, v_uint8x16 &c,
v_uint8x16 &d) {
__m128i u0 = _mm_loadu_si128((const __m128i *) ptr); // a0 b0 c0 d0 a1 b1 c1 d1 ...
__m128i u1 = _mm_loadu_si128((const __m128i *) (ptr + 16)); // a4 b4 c4 d4 ...
__m128i u2 = _mm_loadu_si128((const __m128i *) (ptr + 32)); // a8 b8 c8 d8 ...
__m128i u3 = _mm_loadu_si128((const __m128i *) (ptr + 48)); // a12 b12 c12 d12 ...
__m128i v0 = _mm_unpacklo_epi8(u0, u2); // a0 a8 b0 b8 ...
__m128i v1 = _mm_unpackhi_epi8(u0, u2); // a2 a10 b2 b10 ...
__m128i v2 = _mm_unpacklo_epi8(u1, u3); // a4 a12 b4 b12 ...
__m128i v3 = _mm_unpackhi_epi8(u1, u3); // a6 a14 b6 b14 ...
u0 = _mm_unpacklo_epi8(v0, v2); // a0 a4 a8 a12 ...
u1 = _mm_unpacklo_epi8(v1, v3); // a2 a6 a10 a14 ...
u2 = _mm_unpackhi_epi8(v0, v2); // a1 a5 a9 a13 ...
u3 = _mm_unpackhi_epi8(v1, v3); // a3 a7 a11 a15 ...
v0 = _mm_unpacklo_epi8(u0, u1); // a0 a2 a4 a6 ...
v1 = _mm_unpacklo_epi8(u2, u3); // a1 a3 a5 a7 ...
v2 = _mm_unpackhi_epi8(u0, u1); // c0 c2 c4 c6 ...
v3 = _mm_unpackhi_epi8(u2, u3); // c1 c3 c5 c7 ...
a.val = _mm_unpacklo_epi8(v0, v1);
b.val = _mm_unpackhi_epi8(v0, v1);
c.val = _mm_unpacklo_epi8(v2, v3);
d.val = _mm_unpackhi_epi8(v2, v3);
}
inline void v_load_deinterleave(const ushort *ptr, v_uint16x8 &a, v_uint16x8 &b) {
__m128i v0 = _mm_loadu_si128((__m128i * )(ptr)); // a0 b0 a1 b1 a2 b2 a3 b3
__m128i v1 = _mm_loadu_si128((__m128i * )(ptr + 8)); // a4 b4 a5 b5 a6 b6 a7 b7
__m128i v2 = _mm_unpacklo_epi16(v0, v1); // a0 a4 b0 b4 a1 a5 b1 b5
__m128i v3 = _mm_unpackhi_epi16(v0, v1); // a2 a6 b2 b6 a3 a7 b3 b7
__m128i v4 = _mm_unpacklo_epi16(v2, v3); // a0 a2 a4 a6 b0 b2 b4 b6
__m128i v5 = _mm_unpackhi_epi16(v2, v3); // a1 a3 a5 a7 b1 b3 b5 b7
a.val = _mm_unpacklo_epi16(v4, v5); // a0 a1 a2 a3 a4 a5 a6 a7
b.val = _mm_unpackhi_epi16(v4, v5); // b0 b1 ab b3 b4 b5 b6 b7
}
inline void
v_load_deinterleave(const ushort *ptr, v_uint16x8 &a, v_uint16x8 &b, v_uint16x8 &c) {
#if CV_SSE4_1
__m128i v0 = _mm_loadu_si128((__m128i*)(ptr));
__m128i v1 = _mm_loadu_si128((__m128i*)(ptr + 8));
__m128i v2 = _mm_loadu_si128((__m128i*)(ptr + 16));
__m128i a0 = _mm_blend_epi16(_mm_blend_epi16(v0, v1, 0x92), v2, 0x24);
__m128i b0 = _mm_blend_epi16(_mm_blend_epi16(v2, v0, 0x92), v1, 0x24);
__m128i c0 = _mm_blend_epi16(_mm_blend_epi16(v1, v2, 0x92), v0, 0x24);
const __m128i sh_a = _mm_setr_epi8(0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11);
const __m128i sh_b = _mm_setr_epi8(2, 3, 8, 9, 14, 15, 4, 5, 10, 11, 0, 1, 6, 7, 12, 13);
const __m128i sh_c = _mm_setr_epi8(4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15);
a0 = _mm_shuffle_epi8(a0, sh_a);
b0 = _mm_shuffle_epi8(b0, sh_b);
c0 = _mm_shuffle_epi8(c0, sh_c);
a.val = a0;
b.val = b0;
c.val = c0;
#else
__m128i t00 = _mm_loadu_si128((const __m128i *) ptr);
__m128i t01 = _mm_loadu_si128((const __m128i *) (ptr + 8));
__m128i t02 = _mm_loadu_si128((const __m128i *) (ptr + 16));
__m128i t10 = _mm_unpacklo_epi16(t00, _mm_unpackhi_epi64(t01, t01));
__m128i t11 = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t00, t00), t02);
__m128i t12 = _mm_unpacklo_epi16(t01, _mm_unpackhi_epi64(t02, t02));
__m128i t20 = _mm_unpacklo_epi16(t10, _mm_unpackhi_epi64(t11, t11));
__m128i t21 = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t10, t10), t12);
__m128i t22 = _mm_unpacklo_epi16(t11, _mm_unpackhi_epi64(t12, t12));
a.val = _mm_unpacklo_epi16(t20, _mm_unpackhi_epi64(t21, t21));
b.val = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t20, t20), t22);
c.val = _mm_unpacklo_epi16(t21, _mm_unpackhi_epi64(t22, t22));
#endif
}
inline void v_load_deinterleave(const ushort *ptr, v_uint16x8 &a, v_uint16x8 &b, v_uint16x8 &c,
v_uint16x8 &d) {
__m128i u0 = _mm_loadu_si128((const __m128i *) ptr); // a0 b0 c0 d0 a1 b1 c1 d1
__m128i u1 = _mm_loadu_si128((const __m128i *) (ptr + 8)); // a2 b2 c2 d2 ...
__m128i u2 = _mm_loadu_si128((const __m128i *) (ptr + 16)); // a4 b4 c4 d4 ...
__m128i u3 = _mm_loadu_si128((const __m128i *) (ptr + 24)); // a6 b6 c6 d6 ...
__m128i v0 = _mm_unpacklo_epi16(u0, u2); // a0 a4 b0 b4 ...
__m128i v1 = _mm_unpackhi_epi16(u0, u2); // a1 a5 b1 b5 ...
__m128i v2 = _mm_unpacklo_epi16(u1, u3); // a2 a6 b2 b6 ...
__m128i v3 = _mm_unpackhi_epi16(u1, u3); // a3 a7 b3 b7 ...
u0 = _mm_unpacklo_epi16(v0, v2); // a0 a2 a4 a6 ...
u1 = _mm_unpacklo_epi16(v1, v3); // a1 a3 a5 a7 ...
u2 = _mm_unpackhi_epi16(v0, v2); // c0 c2 c4 c6 ...
u3 = _mm_unpackhi_epi16(v1, v3); // c1 c3 c5 c7 ...
a.val = _mm_unpacklo_epi16(u0, u1);
b.val = _mm_unpackhi_epi16(u0, u1);
c.val = _mm_unpacklo_epi16(u2, u3);
d.val = _mm_unpackhi_epi16(u2, u3);
}
inline void v_load_deinterleave(const unsigned *ptr, v_uint32x4 &a, v_uint32x4 &b) {
__m128i v0 = _mm_loadu_si128((__m128i * )(ptr)); // a0 b0 a1 b1
__m128i v1 = _mm_loadu_si128((__m128i * )(ptr + 4)); // a2 b2 a3 b3
__m128i v2 = _mm_unpacklo_epi32(v0, v1); // a0 a2 b0 b2
__m128i v3 = _mm_unpackhi_epi32(v0, v1); // a1 a3 b1 b3
a.val = _mm_unpacklo_epi32(v2, v3); // a0 a1 a2 a3
b.val = _mm_unpackhi_epi32(v2, v3); // b0 b1 ab b3
}
inline void
v_load_deinterleave(const unsigned *ptr, v_uint32x4 &a, v_uint32x4 &b, v_uint32x4 &c) {
__m128i t00 = _mm_loadu_si128((const __m128i *) ptr);
__m128i t01 = _mm_loadu_si128((const __m128i *) (ptr + 4));
__m128i t02 = _mm_loadu_si128((const __m128i *) (ptr + 8));
__m128i t10 = _mm_unpacklo_epi32(t00, _mm_unpackhi_epi64(t01, t01));
__m128i t11 = _mm_unpacklo_epi32(_mm_unpackhi_epi64(t00, t00), t02);
__m128i t12 = _mm_unpacklo_epi32(t01, _mm_unpackhi_epi64(t02, t02));
a.val = _mm_unpacklo_epi32(t10, _mm_unpackhi_epi64(t11, t11));
b.val = _mm_unpacklo_epi32(_mm_unpackhi_epi64(t10, t10), t12);
c.val = _mm_unpacklo_epi32(t11, _mm_unpackhi_epi64(t12, t12));
}
inline void
v_load_deinterleave(const unsigned *ptr, v_uint32x4 &a, v_uint32x4 &b, v_uint32x4 &c,
v_uint32x4 &d) {
v_uint32x4 s0(_mm_loadu_si128((const __m128i *)ptr)); // a0 b0 c0 d0
v_uint32x4 s1(_mm_loadu_si128((const __m128i *)(ptr
+4))); // a1 b1 c1 d1
v_uint32x4 s2(_mm_loadu_si128((const __m128i *)(ptr
+8))); // a2 b2 c2 d2
v_uint32x4 s3(_mm_loadu_si128((const __m128i *)(ptr
+12))); // a3 b3 c3 d3
v_transpose4x4(s0, s1, s2, s3, a, b, c, d);
}
inline void v_load_deinterleave(const float *ptr, v_float32x4 &a, v_float32x4 &b) {
const int mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1);
__m128 u0 = _mm_loadu_ps(ptr); // a0 b0 a1 b1
__m128 u1 = _mm_loadu_ps((ptr + 4)); // a2 b2 a3 b3
a.val = _mm_shuffle_ps(u0, u1, mask_lo); // a0 a1 a2 a3
b.val = _mm_shuffle_ps(u0, u1, mask_hi); // b0 b1 ab b3
}
inline void
v_load_deinterleave(const float *ptr, v_float32x4 &a, v_float32x4 &b, v_float32x4 &c) {
__m128 t0 = _mm_loadu_ps(ptr + 0);
__m128 t1 = _mm_loadu_ps(ptr + 4);
__m128 t2 = _mm_loadu_ps(ptr + 8);
__m128 at12 = _mm_shuffle_ps(t1, t2, _MM_SHUFFLE(0, 1, 0, 2));
a.val = _mm_shuffle_ps(t0, at12, _MM_SHUFFLE(2, 0, 3, 0));
__m128 bt01 = _mm_shuffle_ps(t0, t1, _MM_SHUFFLE(0, 0, 0, 1));
__m128 bt12 = _mm_shuffle_ps(t1, t2, _MM_SHUFFLE(0, 2, 0, 3));
b.val = _mm_shuffle_ps(bt01, bt12, _MM_SHUFFLE(2, 0, 2, 0));
__m128 ct01 = _mm_shuffle_ps(t0, t1, _MM_SHUFFLE(0, 1, 0, 2));
c.val = _mm_shuffle_ps(ct01, t2, _MM_SHUFFLE(3, 0, 2, 0));
}
inline void
v_load_deinterleave(const float *ptr, v_float32x4 &a, v_float32x4 &b, v_float32x4 &c,
v_float32x4 &d) {
__m128 t0 = _mm_loadu_ps(ptr + 0);
__m128 t1 = _mm_loadu_ps(ptr + 4);
__m128 t2 = _mm_loadu_ps(ptr + 8);
__m128 t3 = _mm_loadu_ps(ptr + 12);
__m128 t02lo = _mm_unpacklo_ps(t0, t2);
__m128 t13lo = _mm_unpacklo_ps(t1, t3);
__m128 t02hi = _mm_unpackhi_ps(t0, t2);
__m128 t13hi = _mm_unpackhi_ps(t1, t3);
a.val = _mm_unpacklo_ps(t02lo, t13lo);
b.val = _mm_unpackhi_ps(t02lo, t13lo);
c.val = _mm_unpacklo_ps(t02hi, t13hi);
d.val = _mm_unpackhi_ps(t02hi, t13hi);
}
inline void v_load_deinterleave(const uint64 *ptr, v_uint64x2 &a, v_uint64x2 &b) {
__m128i t0 = _mm_loadu_si128((const __m128i *) ptr);
__m128i t1 = _mm_loadu_si128((const __m128i *) (ptr + 2));
a = v_uint64x2(_mm_unpacklo_epi64(t0, t1));
b = v_uint64x2(_mm_unpackhi_epi64(t0, t1));
}
inline void
v_load_deinterleave(const uint64 *ptr, v_uint64x2 &a, v_uint64x2 &b, v_uint64x2 &c) {
__m128i t0 = _mm_loadu_si128((const __m128i *) ptr); // a0, b0
__m128i t1 = _mm_loadu_si128((const __m128i *) (ptr + 2)); // c0, a1
__m128i t2 = _mm_loadu_si128((const __m128i *) (ptr + 4)); // b1, c1
t1 = _mm_shuffle_epi32(t1, 0x4e); // a1, c0
a = v_uint64x2(_mm_unpacklo_epi64(t0, t1));
b = v_uint64x2(_mm_unpacklo_epi64(_mm_unpackhi_epi64(t0, t0), t2));
c = v_uint64x2(_mm_unpackhi_epi64(t1, t2));
}
inline void v_load_deinterleave(const uint64 *ptr, v_uint64x2 &a,
v_uint64x2 &b, v_uint64x2 &c, v_uint64x2 &d) {
__m128i t0 = _mm_loadu_si128((const __m128i *) ptr); // a0 b0
__m128i t1 = _mm_loadu_si128((const __m128i *) (ptr + 2)); // c0 d0
__m128i t2 = _mm_loadu_si128((const __m128i *) (ptr + 4)); // a1 b1
__m128i t3 = _mm_loadu_si128((const __m128i *) (ptr + 6)); // c1 d1
a = v_uint64x2(_mm_unpacklo_epi64(t0, t2));
b = v_uint64x2(_mm_unpackhi_epi64(t0, t2));
c = v_uint64x2(_mm_unpacklo_epi64(t1, t3));
d = v_uint64x2(_mm_unpackhi_epi64(t1, t3));
}
// store interleave
inline void v_store_interleave(uchar *ptr, const v_uint8x16 &a, const v_uint8x16 &b,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128i v0 = _mm_unpacklo_epi8(a.val, b.val);
__m128i v1 = _mm_unpackhi_epi8(a.val, b.val);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 16), v1);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 16), v1);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 16), v1);
}
}
inline void v_store_interleave(uchar *ptr, const v_uint8x16 &a, const v_uint8x16 &b,
const v_uint8x16 &c,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
#if CV_SSE4_1
const __m128i sh_a = _mm_setr_epi8(0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10, 5);
const __m128i sh_b = _mm_setr_epi8(5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15, 10);
const __m128i sh_c = _mm_setr_epi8(10, 5, 0, 11, 6, 1, 12, 7, 2, 13, 8, 3, 14, 9, 4, 15);
__m128i a0 = _mm_shuffle_epi8(a.val, sh_a);
__m128i b0 = _mm_shuffle_epi8(b.val, sh_b);
__m128i c0 = _mm_shuffle_epi8(c.val, sh_c);
const __m128i m0 = _mm_setr_epi8(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0);
const __m128i m1 = _mm_setr_epi8(0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0);
__m128i v0 = _mm_blendv_epi8(_mm_blendv_epi8(a0, b0, m1), c0, m0);
__m128i v1 = _mm_blendv_epi8(_mm_blendv_epi8(b0, c0, m1), a0, m0);
__m128i v2 = _mm_blendv_epi8(_mm_blendv_epi8(c0, a0, m1), b0, m0);
#elif CV_SSSE3
const __m128i m0 = _mm_setr_epi8(0, 6, 11, 1, 7, 12, 2, 8, 13, 3, 9, 14, 4, 10, 15, 5);
const __m128i m1 = _mm_setr_epi8(5, 11, 0, 6, 12, 1, 7, 13, 2, 8, 14, 3, 9, 15, 4, 10);
const __m128i m2 = _mm_setr_epi8(10, 0, 5, 11, 1, 6, 12, 2, 7, 13, 3, 8, 14, 4, 9, 15);
__m128i t0 = _mm_alignr_epi8(b.val, _mm_slli_si128(a.val, 10), 5);
t0 = _mm_alignr_epi8(c.val, t0, 5);
__m128i v0 = _mm_shuffle_epi8(t0, m0);
__m128i t1 = _mm_alignr_epi8(_mm_srli_si128(b.val, 5), _mm_slli_si128(a.val, 5), 6);
t1 = _mm_alignr_epi8(_mm_srli_si128(c.val, 5), t1, 5);
__m128i v1 = _mm_shuffle_epi8(t1, m1);
__m128i t2 = _mm_alignr_epi8(_mm_srli_si128(c.val, 10), b.val, 11);
t2 = _mm_alignr_epi8(t2, a.val, 11);
__m128i v2 = _mm_shuffle_epi8(t2, m2);
#else
__m128i z = _mm_setzero_si128();
__m128i ab0 = _mm_unpacklo_epi8(a.val, b.val);
__m128i ab1 = _mm_unpackhi_epi8(a.val, b.val);
__m128i c0 = _mm_unpacklo_epi8(c.val, z);
__m128i c1 = _mm_unpackhi_epi8(c.val, z);
__m128i p00 = _mm_unpacklo_epi16(ab0, c0);
__m128i p01 = _mm_unpackhi_epi16(ab0, c0);
__m128i p02 = _mm_unpacklo_epi16(ab1, c1);
__m128i p03 = _mm_unpackhi_epi16(ab1, c1);
__m128i p10 = _mm_unpacklo_epi32(p00, p01);
__m128i p11 = _mm_unpackhi_epi32(p00, p01);
__m128i p12 = _mm_unpacklo_epi32(p02, p03);
__m128i p13 = _mm_unpackhi_epi32(p02, p03);
__m128i p20 = _mm_unpacklo_epi64(p10, p11);
__m128i p21 = _mm_unpackhi_epi64(p10, p11);
__m128i p22 = _mm_unpacklo_epi64(p12, p13);
__m128i p23 = _mm_unpackhi_epi64(p12, p13);
p20 = _mm_slli_si128(p20, 1);
p22 = _mm_slli_si128(p22, 1);
__m128i p30 = _mm_slli_epi64(_mm_unpacklo_epi32(p20, p21), 8);
__m128i p31 = _mm_srli_epi64(_mm_unpackhi_epi32(p20, p21), 8);
__m128i p32 = _mm_slli_epi64(_mm_unpacklo_epi32(p22, p23), 8);
__m128i p33 = _mm_srli_epi64(_mm_unpackhi_epi32(p22, p23), 8);
__m128i p40 = _mm_unpacklo_epi64(p30, p31);
__m128i p41 = _mm_unpackhi_epi64(p30, p31);
__m128i p42 = _mm_unpacklo_epi64(p32, p33);
__m128i p43 = _mm_unpackhi_epi64(p32, p33);
__m128i v0 = _mm_or_si128(_mm_srli_si128(p40, 2), _mm_slli_si128(p41, 10));
__m128i v1 = _mm_or_si128(_mm_srli_si128(p41, 6), _mm_slli_si128(p42, 6));
__m128i v2 = _mm_or_si128(_mm_srli_si128(p42, 10), _mm_slli_si128(p43, 2));
#endif
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 16), v1);
_mm_stream_si128((__m128i * )(ptr + 32), v2);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 16), v1);
_mm_store_si128((__m128i * )(ptr + 32), v2);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 16), v1);
_mm_storeu_si128((__m128i * )(ptr + 32), v2);
}
}
inline void v_store_interleave(uchar *ptr, const v_uint8x16 &a, const v_uint8x16 &b,
const v_uint8x16 &c, const v_uint8x16 &d,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
// a0 a1 a2 a3 ....
// b0 b1 b2 b3 ....
// c0 c1 c2 c3 ....
// d0 d1 d2 d3 ....
__m128i u0 = _mm_unpacklo_epi8(a.val, c.val); // a0 c0 a1 c1 ...
__m128i u1 = _mm_unpackhi_epi8(a.val, c.val); // a8 c8 a9 c9 ...
__m128i u2 = _mm_unpacklo_epi8(b.val, d.val); // b0 d0 b1 d1 ...
__m128i u3 = _mm_unpackhi_epi8(b.val, d.val); // b8 d8 b9 d9 ...
__m128i v0 = _mm_unpacklo_epi8(u0, u2); // a0 b0 c0 d0 ...
__m128i v1 = _mm_unpackhi_epi8(u0, u2); // a4 b4 c4 d4 ...
__m128i v2 = _mm_unpacklo_epi8(u1, u3); // a8 b8 c8 d8 ...
__m128i v3 = _mm_unpackhi_epi8(u1, u3); // a12 b12 c12 d12 ...
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 16), v1);
_mm_stream_si128((__m128i * )(ptr + 32), v2);
_mm_stream_si128((__m128i * )(ptr + 48), v3);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 16), v1);
_mm_store_si128((__m128i * )(ptr + 32), v2);
_mm_store_si128((__m128i * )(ptr + 48), v3);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 16), v1);
_mm_storeu_si128((__m128i * )(ptr + 32), v2);
_mm_storeu_si128((__m128i * )(ptr + 48), v3);
}
}
inline void v_store_interleave(ushort *ptr, const v_uint16x8 &a, const v_uint16x8 &b,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128i v0 = _mm_unpacklo_epi16(a.val, b.val);
__m128i v1 = _mm_unpackhi_epi16(a.val, b.val);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 8), v1);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 8), v1);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 8), v1);
}
}
inline void v_store_interleave(ushort *ptr, const v_uint16x8 &a,
const v_uint16x8 &b, const v_uint16x8 &c,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
#if CV_SSE4_1
const __m128i sh_a = _mm_setr_epi8(0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11);
const __m128i sh_b = _mm_setr_epi8(10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5);
const __m128i sh_c = _mm_setr_epi8(4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15);
__m128i a0 = _mm_shuffle_epi8(a.val, sh_a);
__m128i b0 = _mm_shuffle_epi8(b.val, sh_b);
__m128i c0 = _mm_shuffle_epi8(c.val, sh_c);
__m128i v0 = _mm_blend_epi16(_mm_blend_epi16(a0, b0, 0x92), c0, 0x24);
__m128i v1 = _mm_blend_epi16(_mm_blend_epi16(c0, a0, 0x92), b0, 0x24);
__m128i v2 = _mm_blend_epi16(_mm_blend_epi16(b0, c0, 0x92), a0, 0x24);
#else
__m128i z = _mm_setzero_si128();
__m128i ab0 = _mm_unpacklo_epi16(a.val, b.val);
__m128i ab1 = _mm_unpackhi_epi16(a.val, b.val);
__m128i c0 = _mm_unpacklo_epi16(c.val, z);
__m128i c1 = _mm_unpackhi_epi16(c.val, z);
__m128i p10 = _mm_unpacklo_epi32(ab0, c0);
__m128i p11 = _mm_unpackhi_epi32(ab0, c0);
__m128i p12 = _mm_unpacklo_epi32(ab1, c1);
__m128i p13 = _mm_unpackhi_epi32(ab1, c1);
__m128i p20 = _mm_unpacklo_epi64(p10, p11);
__m128i p21 = _mm_unpackhi_epi64(p10, p11);
__m128i p22 = _mm_unpacklo_epi64(p12, p13);
__m128i p23 = _mm_unpackhi_epi64(p12, p13);
p20 = _mm_slli_si128(p20, 2);
p22 = _mm_slli_si128(p22, 2);
__m128i p30 = _mm_unpacklo_epi64(p20, p21);
__m128i p31 = _mm_unpackhi_epi64(p20, p21);
__m128i p32 = _mm_unpacklo_epi64(p22, p23);
__m128i p33 = _mm_unpackhi_epi64(p22, p23);
__m128i v0 = _mm_or_si128(_mm_srli_si128(p30, 2), _mm_slli_si128(p31, 10));
__m128i v1 = _mm_or_si128(_mm_srli_si128(p31, 6), _mm_slli_si128(p32, 6));
__m128i v2 = _mm_or_si128(_mm_srli_si128(p32, 10), _mm_slli_si128(p33, 2));
#endif
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 8), v1);
_mm_stream_si128((__m128i * )(ptr + 16), v2);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 8), v1);
_mm_store_si128((__m128i * )(ptr + 16), v2);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 8), v1);
_mm_storeu_si128((__m128i * )(ptr + 16), v2);
}
}
inline void v_store_interleave(ushort *ptr, const v_uint16x8 &a, const v_uint16x8 &b,
const v_uint16x8 &c, const v_uint16x8 &d,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
// a0 a1 a2 a3 ....
// b0 b1 b2 b3 ....
// c0 c1 c2 c3 ....
// d0 d1 d2 d3 ....
__m128i u0 = _mm_unpacklo_epi16(a.val, c.val); // a0 c0 a1 c1 ...
__m128i u1 = _mm_unpackhi_epi16(a.val, c.val); // a4 c4 a5 c5 ...
__m128i u2 = _mm_unpacklo_epi16(b.val, d.val); // b0 d0 b1 d1 ...
__m128i u3 = _mm_unpackhi_epi16(b.val, d.val); // b4 d4 b5 d5 ...
__m128i v0 = _mm_unpacklo_epi16(u0, u2); // a0 b0 c0 d0 ...
__m128i v1 = _mm_unpackhi_epi16(u0, u2); // a2 b2 c2 d2 ...
__m128i v2 = _mm_unpacklo_epi16(u1, u3); // a4 b4 c4 d4 ...
__m128i v3 = _mm_unpackhi_epi16(u1, u3); // a6 b6 c6 d6 ...
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 8), v1);
_mm_stream_si128((__m128i * )(ptr + 16), v2);
_mm_stream_si128((__m128i * )(ptr + 24), v3);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 8), v1);
_mm_store_si128((__m128i * )(ptr + 16), v2);
_mm_store_si128((__m128i * )(ptr + 24), v3);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 8), v1);
_mm_storeu_si128((__m128i * )(ptr + 16), v2);
_mm_storeu_si128((__m128i * )(ptr + 24), v3);
}
}
inline void v_store_interleave(unsigned *ptr, const v_uint32x4 &a, const v_uint32x4 &b,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128i v0 = _mm_unpacklo_epi32(a.val, b.val);
__m128i v1 = _mm_unpackhi_epi32(a.val, b.val);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 4), v1);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 4), v1);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 4), v1);
}
}
inline void v_store_interleave(unsigned *ptr, const v_uint32x4 &a, const v_uint32x4 &b,
const v_uint32x4 &c,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
v_uint32x4 z = v_setzero_u32(), u0, u1, u2, u3;
v_transpose4x4(a, b, c, z, u0, u1, u2, u3);
__m128i v0 = _mm_or_si128(u0.val, _mm_slli_si128(u1.val, 12));
__m128i v1 = _mm_or_si128(_mm_srli_si128(u1.val, 4), _mm_slli_si128(u2.val, 8));
__m128i v2 = _mm_or_si128(_mm_srli_si128(u2.val, 8), _mm_slli_si128(u3.val, 4));
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 4), v1);
_mm_stream_si128((__m128i * )(ptr + 8), v2);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 4), v1);
_mm_store_si128((__m128i * )(ptr + 8), v2);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 4), v1);
_mm_storeu_si128((__m128i * )(ptr + 8), v2);
}
}
inline void v_store_interleave(unsigned *ptr, const v_uint32x4 &a, const v_uint32x4 &b,
const v_uint32x4 &c, const v_uint32x4 &d,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
v_uint32x4 v0, v1, v2, v3;
v_transpose4x4(a, b, c, d, v0, v1, v2, v3);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0.val);
_mm_stream_si128((__m128i * )(ptr + 4), v1.val);
_mm_stream_si128((__m128i * )(ptr + 8), v2.val);
_mm_stream_si128((__m128i * )(ptr + 12), v3.val);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0.val);
_mm_store_si128((__m128i * )(ptr + 4), v1.val);
_mm_store_si128((__m128i * )(ptr + 8), v2.val);
_mm_store_si128((__m128i * )(ptr + 12), v3.val);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0.val);
_mm_storeu_si128((__m128i * )(ptr + 4), v1.val);
_mm_storeu_si128((__m128i * )(ptr + 8), v2.val);
_mm_storeu_si128((__m128i * )(ptr + 12), v3.val);
}
}
// 2-channel, float only
inline void v_store_interleave(float *ptr, const v_float32x4 &a, const v_float32x4 &b,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128 v0 = _mm_unpacklo_ps(a.val, b.val); // a0 b0 a1 b1
__m128 v1 = _mm_unpackhi_ps(a.val, b.val); // a2 b2 a3 b3
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_ps(ptr, v0);
_mm_stream_ps(ptr + 4, v1);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_ps(ptr, v0);
_mm_store_ps(ptr + 4, v1);
} else {
_mm_storeu_ps(ptr, v0);
_mm_storeu_ps(ptr + 4, v1);
}
}
inline void v_store_interleave(float *ptr, const v_float32x4 &a, const v_float32x4 &b,
const v_float32x4 &c,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128 u0 = _mm_shuffle_ps(a.val, b.val, _MM_SHUFFLE(0, 0, 0, 0));
__m128 u1 = _mm_shuffle_ps(c.val, a.val, _MM_SHUFFLE(1, 1, 0, 0));
__m128 v0 = _mm_shuffle_ps(u0, u1, _MM_SHUFFLE(2, 0, 2, 0));
__m128 u2 = _mm_shuffle_ps(b.val, c.val, _MM_SHUFFLE(1, 1, 1, 1));
__m128 u3 = _mm_shuffle_ps(a.val, b.val, _MM_SHUFFLE(2, 2, 2, 2));
__m128 v1 = _mm_shuffle_ps(u2, u3, _MM_SHUFFLE(2, 0, 2, 0));
__m128 u4 = _mm_shuffle_ps(c.val, a.val, _MM_SHUFFLE(3, 3, 2, 2));
__m128 u5 = _mm_shuffle_ps(b.val, c.val, _MM_SHUFFLE(3, 3, 3, 3));
__m128 v2 = _mm_shuffle_ps(u4, u5, _MM_SHUFFLE(2, 0, 2, 0));
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_ps(ptr, v0);
_mm_stream_ps(ptr + 4, v1);
_mm_stream_ps(ptr + 8, v2);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_ps(ptr, v0);
_mm_store_ps(ptr + 4, v1);
_mm_store_ps(ptr + 8, v2);
} else {
_mm_storeu_ps(ptr, v0);
_mm_storeu_ps(ptr + 4, v1);
_mm_storeu_ps(ptr + 8, v2);
}
}
inline void v_store_interleave(float *ptr, const v_float32x4 &a, const v_float32x4 &b,
const v_float32x4 &c, const v_float32x4 &d,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128 u0 = _mm_unpacklo_ps(a.val, c.val);
__m128 u1 = _mm_unpacklo_ps(b.val, d.val);
__m128 u2 = _mm_unpackhi_ps(a.val, c.val);
__m128 u3 = _mm_unpackhi_ps(b.val, d.val);
__m128 v0 = _mm_unpacklo_ps(u0, u1);
__m128 v2 = _mm_unpacklo_ps(u2, u3);
__m128 v1 = _mm_unpackhi_ps(u0, u1);
__m128 v3 = _mm_unpackhi_ps(u2, u3);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_ps(ptr, v0);
_mm_stream_ps(ptr + 4, v1);
_mm_stream_ps(ptr + 8, v2);
_mm_stream_ps(ptr + 12, v3);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_ps(ptr, v0);
_mm_store_ps(ptr + 4, v1);
_mm_store_ps(ptr + 8, v2);
_mm_store_ps(ptr + 12, v3);
} else {
_mm_storeu_ps(ptr, v0);
_mm_storeu_ps(ptr + 4, v1);
_mm_storeu_ps(ptr + 8, v2);
_mm_storeu_ps(ptr + 12, v3);
}
}
inline void v_store_interleave(uint64 *ptr, const v_uint64x2 &a, const v_uint64x2 &b,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128i v0 = _mm_unpacklo_epi64(a.val, b.val);
__m128i v1 = _mm_unpackhi_epi64(a.val, b.val);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 2), v1);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 2), v1);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 2), v1);
}
}
inline void v_store_interleave(uint64 *ptr, const v_uint64x2 &a, const v_uint64x2 &b,
const v_uint64x2 &c,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128i v0 = _mm_unpacklo_epi64(a.val, b.val);
__m128i v1 = _mm_unpacklo_epi64(c.val, _mm_unpackhi_epi64(a.val, a.val));
__m128i v2 = _mm_unpackhi_epi64(b.val, c.val);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 2), v1);
_mm_stream_si128((__m128i * )(ptr + 4), v2);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 2), v1);
_mm_store_si128((__m128i * )(ptr + 4), v2);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 2), v1);
_mm_storeu_si128((__m128i * )(ptr + 4), v2);
}
}
inline void v_store_interleave(uint64 *ptr, const v_uint64x2 &a, const v_uint64x2 &b,
const v_uint64x2 &c, const v_uint64x2 &d,
hal::StoreMode mode = hal::STORE_UNALIGNED) {
__m128i v0 = _mm_unpacklo_epi64(a.val, b.val);
__m128i v1 = _mm_unpacklo_epi64(c.val, d.val);
__m128i v2 = _mm_unpackhi_epi64(a.val, b.val);
__m128i v3 = _mm_unpackhi_epi64(c.val, d.val);
if (mode == hal::STORE_ALIGNED_NOCACHE) {
_mm_stream_si128((__m128i * )(ptr), v0);
_mm_stream_si128((__m128i * )(ptr + 2), v1);
_mm_stream_si128((__m128i * )(ptr + 4), v2);
_mm_stream_si128((__m128i * )(ptr + 6), v3);
} else if (mode == hal::STORE_ALIGNED) {
_mm_store_si128((__m128i * )(ptr), v0);
_mm_store_si128((__m128i * )(ptr + 2), v1);
_mm_store_si128((__m128i * )(ptr + 4), v2);
_mm_store_si128((__m128i * )(ptr + 6), v3);
} else {
_mm_storeu_si128((__m128i * )(ptr), v0);
_mm_storeu_si128((__m128i * )(ptr + 2), v1);
_mm_storeu_si128((__m128i * )(ptr + 4), v2);
_mm_storeu_si128((__m128i * )(ptr + 6), v3);
}
}
#define OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(_Tpvec0, _Tp0, suffix0, _Tpvec1, _Tp1, suffix1) \
inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0 ) \
{ \
_Tpvec1 a1, b1; \
v_load_deinterleave((const _Tp1*)ptr, a1, b1); \
a0 = v_reinterpret_as_##suffix0(a1); \
b0 = v_reinterpret_as_##suffix0(b1); \
} \
inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0 ) \
{ \
_Tpvec1 a1, b1, c1; \
v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1); \
a0 = v_reinterpret_as_##suffix0(a1); \
b0 = v_reinterpret_as_##suffix0(b1); \
c0 = v_reinterpret_as_##suffix0(c1); \
} \
inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0, _Tpvec0& d0 ) \
{ \
_Tpvec1 a1, b1, c1, d1; \
v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1, d1); \
a0 = v_reinterpret_as_##suffix0(a1); \
b0 = v_reinterpret_as_##suffix0(b1); \
c0 = v_reinterpret_as_##suffix0(c1); \
d0 = v_reinterpret_as_##suffix0(d1); \
} \
inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \
hal::StoreMode mode = hal::STORE_UNALIGNED ) \
{ \
_Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \
_Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \
v_store_interleave((_Tp1*)ptr, a1, b1, mode); \
} \
inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \
const _Tpvec0& c0, hal::StoreMode mode = hal::STORE_UNALIGNED ) \
{ \
_Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \
_Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \
_Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \
v_store_interleave((_Tp1*)ptr, a1, b1, c1, mode); \
} \
inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \
const _Tpvec0& c0, const _Tpvec0& d0, \
hal::StoreMode mode = hal::STORE_UNALIGNED ) \
{ \
_Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \
_Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \
_Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \
_Tpvec1 d1 = v_reinterpret_as_##suffix1(d0); \
v_store_interleave((_Tp1*)ptr, a1, b1, c1, d1, mode); \
}
OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int8x16, schar, s8, v_uint8x16, uchar, u8)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int16x8, short, s16, v_uint16x8, ushort, u16)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int32x4, int, s32, v_uint32x4, unsigned, u32)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int64x2, int64, s64, v_uint64x2, uint64, u64)
OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_float64x2, double, f64, v_uint64x2, uint64, u64)
inline v_float32x4 v_cvt_f32(const v_int32x4 &a) {
return v_float32x4(_mm_cvtepi32_ps(a.val));
}
inline v_float32x4 v_cvt_f32(const v_float64x2 &a) {
return v_float32x4(_mm_cvtpd_ps(a.val));
}
inline v_float32x4 v_cvt_f32(const v_float64x2 &a, const v_float64x2 &b) {
return v_float32x4(_mm_movelh_ps(_mm_cvtpd_ps(a.val), _mm_cvtpd_ps(b.val)));
}
inline v_float64x2 v_cvt_f64(const v_int32x4 &a) {
return v_float64x2(_mm_cvtepi32_pd(a.val));
}
inline v_float64x2 v_cvt_f64_high(const v_int32x4 &a) {
return v_float64x2(_mm_cvtepi32_pd(_mm_srli_si128(a.val, 8)));
}
inline v_float64x2 v_cvt_f64(const v_float32x4 &a) {
return v_float64x2(_mm_cvtps_pd(a.val));
}
inline v_float64x2 v_cvt_f64_high(const v_float32x4 &a) {
return v_float64x2(_mm_cvtps_pd(_mm_movehl_ps(a.val, a.val)));
}
#if CV_FP16
inline v_float32x4 v128_load_fp16_f32(const short* ptr)
{
return v_float32x4(_mm_cvtph_ps(_mm_loadu_si128((const __m128i*)ptr)));
}
inline void v_store_fp16(short* ptr, const v_float32x4& a)
{
__m128i fp16_value = _mm_cvtps_ph(a.val, 0);
_mm_storel_epi64((__m128i*)ptr, fp16_value);
}
#endif
////////////// Lookup table access ////////////////////
inline v_int32x4 v_lut(const int *tab, const v_int32x4 &idxvec) {
int CV_DECL_ALIGNED(32) idx[4];
v_store_aligned(idx, idxvec);
return v_int32x4(_mm_setr_epi32(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]));
}
inline v_float32x4 v_lut(const float *tab, const v_int32x4 &idxvec) {
int CV_DECL_ALIGNED(32) idx[4];
v_store_aligned(idx, idxvec);
return v_float32x4(_mm_setr_ps(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]));
}
inline v_float64x2 v_lut(const double *tab, const v_int32x4 &idxvec) {
int idx[2];
v_store_low(idx, idxvec);
return v_float64x2(_mm_setr_pd(tab[idx[0]], tab[idx[1]]));
}
// loads pairs from the table and deinterleaves them, e.g. returns:
// x = (tab[idxvec[0], tab[idxvec[1]], tab[idxvec[2]], tab[idxvec[3]]),
// y = (tab[idxvec[0]+1], tab[idxvec[1]+1], tab[idxvec[2]+1], tab[idxvec[3]+1])
// note that the indices are float's indices, not the float-pair indices.
// in theory, this function can be used to implement bilinear interpolation,
// when idxvec are the offsets within the image.
inline void
v_lut_deinterleave(const float *tab, const v_int32x4 &idxvec, v_float32x4 &x, v_float32x4 &y) {
int CV_DECL_ALIGNED(32) idx[4];
v_store_aligned(idx, idxvec);
__m128 z = _mm_setzero_ps();
__m128 xy01 = _mm_loadl_pi(z, (__m64 * )(tab + idx[0]));
__m128 xy23 = _mm_loadl_pi(z, (__m64 * )(tab + idx[2]));
xy01 = _mm_loadh_pi(xy01, (__m64 * )(tab + idx[1]));
xy23 = _mm_loadh_pi(xy23, (__m64 * )(tab + idx[3]));
__m128 xxyy02 = _mm_unpacklo_ps(xy01, xy23);
__m128 xxyy13 = _mm_unpackhi_ps(xy01, xy23);
x = v_float32x4(_mm_unpacklo_ps(xxyy02, xxyy13));
y = v_float32x4(_mm_unpackhi_ps(xxyy02, xxyy13));
}
inline void
v_lut_deinterleave(const double *tab, const v_int32x4 &idxvec, v_float64x2 &x, v_float64x2 &y) {
int idx[2];
v_store_low(idx, idxvec);
__m128d xy0 = _mm_loadu_pd(tab + idx[0]);
__m128d xy1 = _mm_loadu_pd(tab + idx[1]);
x = v_float64x2(_mm_unpacklo_pd(xy0, xy1));
y = v_float64x2(_mm_unpackhi_pd(xy0, xy1));
}
////////////// FP16 support ///////////////////////////
inline v_float32x4 v_load_expand(const float16_t *ptr) {
const __m128i z = _mm_setzero_si128(), delta = _mm_set1_epi32(0x38000000);
const __m128i signmask = _mm_set1_epi32(0x80000000), maxexp = _mm_set1_epi32(0x7c000000);
const __m128 deltaf = _mm_castsi128_ps(_mm_set1_epi32(0x38800000));
__m128i bits = _mm_unpacklo_epi16(z, _mm_loadl_epi64((const __m128i *) ptr)); // h << 16
__m128i e = _mm_and_si128(bits, maxexp), sign = _mm_and_si128(bits, signmask);
__m128i t = _mm_add_epi32(_mm_srli_epi32(_mm_xor_si128(bits, sign), 3),
delta); // ((h & 0x7fff) << 13) + delta
__m128i zt = _mm_castps_si128(
_mm_sub_ps(_mm_castsi128_ps(_mm_add_epi32(t, _mm_set1_epi32(1 << 23))), deltaf));
t = _mm_add_epi32(t, _mm_and_si128(delta, _mm_cmpeq_epi32(maxexp, e)));
__m128i zmask = _mm_cmpeq_epi32(e, z);
__m128i ft = v_select_si128(zmask, zt, t);
return v_float32x4(_mm_castsi128_ps(_mm_or_si128(ft, sign)));
}
inline void v_pack_store(float16_t *ptr, const v_float32x4 &v) {
const __m128i signmask = _mm_set1_epi32(0x80000000);
const __m128i rval = _mm_set1_epi32(0x3f000000);
__m128i t = _mm_castps_si128(v.val);
__m128i sign = _mm_srai_epi32(_mm_and_si128(t, signmask), 16);
t = _mm_andnot_si128(signmask, t);
__m128i finitemask = _mm_cmpgt_epi32(_mm_set1_epi32(0x47800000), t);
__m128i isnan = _mm_cmpgt_epi32(t, _mm_set1_epi32(0x7f800000));
__m128i naninf = v_select_si128(isnan, _mm_set1_epi32(0x7e00), _mm_set1_epi32(0x7c00));
__m128i tinymask = _mm_cmpgt_epi32(_mm_set1_epi32(0x38800000), t);
__m128i tt = _mm_castps_si128(_mm_add_ps(_mm_castsi128_ps(t), _mm_castsi128_ps(rval)));
tt = _mm_sub_epi32(tt, rval);
__m128i odd = _mm_and_si128(_mm_srli_epi32(t, 13), _mm_set1_epi32(1));
__m128i nt = _mm_add_epi32(t, _mm_set1_epi32(0xc8000fff));
nt = _mm_srli_epi32(_mm_add_epi32(nt, odd), 13);
t = v_select_si128(tinymask, tt, nt);
t = v_select_si128(finitemask, t, naninf);
t = _mm_or_si128(t, sign);
t = _mm_packs_epi32(t, t);
_mm_storel_epi64((__m128i *) ptr, t);
}
inline void v_cleanup() {}
//! @name Check SIMD support
//! @{
//! @brief Check CPU capability of SIMD operation
static inline bool hasSIMD128() {
return (CV_CPU_HAS_SUPPORT_SSE2) ? true : false;
}
//! @}
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
//! @endcond
}
#endif
| [
"602409866@qq.com"
] | 602409866@qq.com |
b4c828c4e2db73306863264f3b0da81338c90ef8 | 692c363d64762bdf0b612a5af09b14a0d2de2925 | /build-mockpig-Desktop_Qt_5_9_2_MinGW_32bit-Debug/debug/qrc_pigphoto.cpp | 00e0156ee21125f12071cab0e9d134f5b28243f4 | [] | no_license | guaiguaiduo/20200909 | be8975e7a40c53e8192c9e12e0cf3895452cc632 | 0f5dc7d75b9578b6c9a051b82275717ffc0f3c20 | refs/heads/master | 2022-12-10T12:36:44.672717 | 2020-09-09T14:06:58 | 2020-09-09T14:06:58 | 294,130,731 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 88,216 | cpp | /****************************************************************************
** Resource object code
**
** Created by: The Resource Compiler for Qt version 5.9.2
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
static const unsigned char qt_resource_data[] = {
// C:/Users/DELL/Desktop/56/qt/pig/mockpig/u=3128062981,4265614218&fm=26&gp=0.jpg
0x0,0x0,0x40,0x26,
0xff,
0xd8,0xff,0xe0,0x0,0x10,0x4a,0x46,0x49,0x46,0x0,0x1,0x1,0x0,0x0,0x1,0x0,
0x1,0x0,0x0,0xff,0xfe,0x0,0x3b,0x43,0x52,0x45,0x41,0x54,0x4f,0x52,0x3a,0x20,
0x67,0x64,0x2d,0x6a,0x70,0x65,0x67,0x20,0x76,0x31,0x2e,0x30,0x20,0x28,0x75,0x73,
0x69,0x6e,0x67,0x20,0x49,0x4a,0x47,0x20,0x4a,0x50,0x45,0x47,0x20,0x76,0x39,0x30,
0x29,0x2c,0x20,0x71,0x75,0x61,0x6c,0x69,0x74,0x79,0x20,0x3d,0x20,0x38,0x36,0xa,
0xff,0xdb,0x0,0x43,0x0,0x4,0x3,0x3,0x4,0x3,0x3,0x4,0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3,0x8f,0x86,0x7e,0x1f,0xd6,0x3c,0xfd,
0xf7,0x1e,0x47,0xd9,0xee,0xbf,0xeb,0xa4,0x75,0xcd,0x5e,0x99,0xef,0x64,0xd5,0x3f,
0xe5,0xd9,0xe8,0x15,0x25,0x47,0x52,0x56,0x7,0xd1,0x5,0x14,0x51,0x40,0x5,0x14,
0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,
0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,
0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,
0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x5,0x14,0x51,0x40,0x11,0xd1,
0x45,0x12,0x50,0x41,0x97,0xae,0xeb,0x10,0x78,0x7f,0x44,0xd4,0x35,0x5b,0xa9,0x3f,
0xd1,0xed,0x2d,0x64,0x9e,0xbf,0x2c,0x25,0x96,0xef,0xc5,0x1a,0xbd,0xfd,0xf3,0xff,
0x0,0xac,0xbb,0x9a,0x49,0xde,0xbe,0xdc,0xfd,0xae,0x7c,0x5f,0xff,0x0,0x8,0xe7,
0xc3,0xa8,0xf4,0x78,0x64,0x29,0x77,0xad,0x4d,0xe4,0x71,0xff,0x0,0x3c,0x23,0xfb,
0xf5,0xf2,0x77,0x83,0x34,0x74,0xb7,0xb2,0xf3,0xe6,0xad,0x29,0x9e,0x6,0x65,0xfb,
0xca,0x9e,0xcc,0x93,0x4c,0xf0,0xbc,0x16,0xfe,0x5e,0xff,0x0,0xf5,0x95,0xb9,0x26,
0x96,0x92,0x25,0x58,0x92,0xe3,0xfe,0x78,0x56,0x7d,0xdd,0xe7,0x97,0xfe,0xbe,0x4a,
0x5e,0xd0,0x3d,0xca,0x70,0x39,0xfb,0xfd,0x3e,0xd6,0xde,0x7a,0xaf,0x1f,0x97,0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cb,0x8f,0x7d,0x74,0x10,
0x68,0xf0,0x5b,0xc1,0xbd,0xe3,0xac,0xcd,0x62,0xce,0x38,0xd4,0x6c,0xf9,0x2b,0x7f,
0x66,0x70,0xfd,0x6c,0xad,0xe6,0x41,0x1d,0x15,0x5e,0x38,0xe8,0xac,0xcd,0x3d,0xb9,
0xb1,0x45,0x57,0xfb,0x45,0x1f,0x6c,0xf2,0xeb,0x73,0x94,0xb1,0x51,0xdc,0x5c,0x79,
0x74,0x7d,0xa1,0x2b,0x3e,0x49,0x3e,0xd0,0xf4,0xa,0x99,0xa1,0x69,0x27,0x98,0x95,
0x62,0xab,0xc7,0xfe,0xae,0x89,0x24,0xa0,0x3d,0x99,0x62,0xb1,0xee,0xe3,0xfb,0x3c,
0xff,0x0,0x27,0xfa,0xba,0xb9,0x26,0xfa,0x8e,0xee,0x3f,0xf4,0x29,0x24,0x7a,0x8a,
0x81,0x4c,0xfa,0x6b,0xf6,0x29,0xf0,0x9f,0x9f,0x79,0xe2,0x2f,0x16,0x4e,0x87,0xfd,
0x1c,0x7d,0x86,0x1f,0x6f,0xf9,0x68,0xff,0x0,0xa6,0x2b,0xec,0x6f,0x2e,0xbc,0x87,
0xf6,0x61,0xd0,0x3f,0xb0,0x3e,0xd,0x68,0x98,0x52,0x67,0xd4,0xbc,0xcb,0xe7,0x27,
0xd1,0xfa,0x57,0xb1,0x57,0xd,0x43,0xec,0xf0,0x14,0xf9,0x28,0x11,0xd4,0x94,0x54,
0x95,0x7,0x70,0x51,0x45,0x14,0x16,0x14,0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,
0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,
0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,
0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,0x51,0x45,0x0,0x14,
0x51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x77,0x1f,0xff,0x0,0xb,0xd7,
0xe2,0x4f,0xfd,0xe,0xba,0xcf,0xfe,0x4,0x1a,0x3f,0xe1,0x7a,0xfc,0x49,0xff,0x0,
0xa1,0xd7,0x59,0xff,0x0,0xc0,0x83,0x45,0x15,0x37,0x2e,0xec,0x3f,0xe1,0x7c,0xfc,
0x4c,0xff,0x0,0xa1,0xdf,0x5b,0xff,0x0,0xc0,0x96,0xa4,0xff,0x0,0x85,0xef,0xf1,
0x2b,0xfe,0x87,0x6d,0x6f,0xff,0x0,0x2,0x4d,0x14,0x53,0x23,0x99,0x8a,0x3e,0x3c,
0xfc,0x4b,0x3f,0xf3,0x3b,0xeb,0x7f,0xf8,0x12,0x6b,0x8c,0xd7,0x35,0xfd,0x4f,0xc4,
0x3a,0xcd,0xc6,0xa1,0xaa,0x5e,0xcd,0x77,0x7b,0x3f,0xfa,0xc9,0x65,0x39,0x66,0xfa,
0xd1,0x45,0x34,0x65,0x55,0xfb,0x86,0x6c,0x93,0x3f,0xf7,0x8d,0x44,0x2e,0x25,0xcf,
0xfa,0xc6,0xfc,0xe8,0xa2,0xb7,0x38,0x60,0x27,0xda,0x66,0xff,0x0,0x9e,0x8d,0xf9,
0xd4,0xbe,0x7c,0x9f,0xdf,0x34,0x51,0x41,0x43,0x22,0x95,0xd5,0xc6,0x18,0xd1,0x45,
0x14,0x10,0xcf,0xff,0xd9,
};
static const unsigned char qt_resource_name[] = {
// new
0x0,0x3,
0x0,0x0,0x74,0xc7,
0x0,0x6e,
0x0,0x65,0x0,0x77,
// prefix1
0x0,0x7,
0x7,0x8b,0xd0,0x51,
0x0,0x70,
0x0,0x72,0x0,0x65,0x0,0x66,0x0,0x69,0x0,0x78,0x0,0x31,
// u=3128062981,4265614218&fm=26&gp=0.jpg
0x0,0x26,
0x0,0xd7,0xc,0x67,
0x0,0x75,
0x0,0x3d,0x0,0x33,0x0,0x31,0x0,0x32,0x0,0x38,0x0,0x30,0x0,0x36,0x0,0x32,0x0,0x39,0x0,0x38,0x0,0x31,0x0,0x2c,0x0,0x34,0x0,0x32,0x0,0x36,0x0,0x35,
0x0,0x36,0x0,0x31,0x0,0x34,0x0,0x32,0x0,0x31,0x0,0x38,0x0,0x26,0x0,0x66,0x0,0x6d,0x0,0x3d,0x0,0x32,0x0,0x36,0x0,0x26,0x0,0x67,0x0,0x70,0x0,0x3d,
0x0,0x30,0x0,0x2e,0x0,0x6a,0x0,0x70,0x0,0x67,
};
static const unsigned char qt_resource_struct[] = {
// :
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/new
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/new/prefix1
0x0,0x0,0x0,0xc,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x3,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
// :/new/prefix1/u=3128062981,4265614218&fm=26&gp=0.jpg
0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
0x0,0x0,0x1,0x74,0x70,0x8e,0x49,0x4d,
};
#ifdef QT_NAMESPACE
# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
# define QT_RCC_MANGLE_NAMESPACE0(x) x
# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
#else
# define QT_RCC_PREPEND_NAMESPACE(name) name
# define QT_RCC_MANGLE_NAMESPACE(name) name
#endif
#ifdef QT_NAMESPACE
namespace QT_NAMESPACE {
#endif
bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
#ifdef QT_NAMESPACE
}
#endif
int QT_RCC_MANGLE_NAMESPACE(qInitResources_pigphoto)();
int QT_RCC_MANGLE_NAMESPACE(qInitResources_pigphoto)()
{
QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
(0x2, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_pigphoto)();
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_pigphoto)()
{
QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
(0x2, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
namespace {
struct initializer {
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_pigphoto)(); }
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_pigphoto)(); }
} dummy;
}
| [
"noreply@github.com"
] | noreply@github.com |
7b6a5f53b0688c557e8c84f40d3769ca2c07f67e | b5e4b3c4044785818511a515a9bc0546d9d50b10 | /KS_VECTOR.cpp | 63bd3dd149046cedddf09755d8db84fc3bc098d8 | [] | no_license | jbum/Sparkletts | 38553bb37dde967faa40e6677963dc4bf5641be8 | e2ea0e12e9a2b2eca62c7497289f248f42a47262 | refs/heads/master | 2021-01-01T15:54:50.538029 | 2014-11-11T23:43:16 | 2014-11-11T23:43:16 | 26,510,275 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,869 | cpp | #include "Scope.h"
#include <math.h>
void SetVector3(K_VECTOR3 *v, float x, float y, float z)
{
v->x = x;
v->y = y;
v->z = z;
}
void Vec3Subtract(K_VECTOR3 *res, K_VECTOR3 *a, K_VECTOR3 *b)
{
res->x = a->x - b->x;
res->y = a->y - b->y;
res->z = a->z - b->z;
}
void Vec3Add(K_VECTOR3 *res, K_VECTOR3 *a, K_VECTOR3 *b)
{
res->x = a->x + b->x;
res->y = a->y + b->y;
res->z = a->z + b->z;
}
void Vec3Multiply(K_VECTOR3 *res, K_VECTOR3 *a, K_VECTOR3 *b)
{
res->x = a->x * b->x;
res->y = a->y * b->y;
res->z = a->z * b->z;
}
GLfloat Vec3Length(K_VECTOR3 *v)
{
return (GLfloat) sqrt(v->x*v->x + v->y*v->y + v->z*v->z);
}
void Vec3Normalize(K_VECTOR3 *v)
{
float len = Vec3Length(v);
if (len != 0)
{
v->x /= len;
v->y /= len;
v->z /= len;
}
}
KS_VECTOR3::KS_VECTOR3()
{
x = 0;
y = 0;
z = 0;
}
KS_VECTOR3::KS_VECTOR3(GLfloat x, GLfloat y, GLfloat z)
{
this->x = x;
this->y = y;
this->z = z;
}
KS_VECTOR3::KS_VECTOR3(GLfloat *xyz)
{
this->x = xyz[0];
this->y = xyz[1];
this->z = xyz[2];
}
// Calculates 3rd degree polynomial based on array of 4 points
// and a single variable (u) which is generally between 0 and 1
KS_VECTOR3 KS_VECTOR3::Bernstein(float u, KS_VECTOR3 *p)
{
KS_VECTOR3 a, b, c, d;
a = p[0] * pow(u,3);
b = p[1] * (3*pow(u,2)*(1-u));
c = p[2] * (3*u*pow((1-u),2));
d = p[3] * pow((1-u),3);
return a+b+c+d;
}
KS_VECTOR2::KS_VECTOR2()
{
x = 0;
y = 0;
}
KS_VECTOR2::KS_VECTOR2(GLfloat x, GLfloat y)
{
this->x = x;
this->y = y;
}
KS_VECTOR2::KS_VECTOR2(GLfloat *xy)
{
this->x = xy[0];
this->y = xy[1];
}
| [
"jim.bumgardner@digisynd.com"
] | jim.bumgardner@digisynd.com |
0b117fc6c8a6630079608eb2bb5b231df124b936 | 9a488a219a4f73086dc704c163d0c4b23aabfc1f | /tags/Release-0_9_13/src/TextTheme.hh | 80064f65783904740715de2824d84f1c8e950070 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | BackupTheBerlios/fluxbox-svn | 47b8844b562f56d02b211fd4323c2a761b473d5b | 3ac62418ccf8ffaddbf3c181f28d2f652543f83f | refs/heads/master | 2016-09-05T14:55:27.249504 | 2007-12-14T23:27:57 | 2007-12-14T23:27:57 | 40,667,038 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,085 | hh | // TextTheme.hh
// Copyright (c) 2003 - 2005 Henrik Kinnunen (fluxgen at fluxbox dot org)
// and Simon Bowden (rathnor at users.sourceforge.net)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id$
#ifndef TEXTTHEME_HH
#define TEXTTHEME_HH
#include "FbTk/Theme.hh"
#include "FbTk/Font.hh"
#include "FbTk/Color.hh"
#include "FbTk/Text.hh"
#include "FbTk/GContext.hh"
class TextTheme {
public:
TextTheme(FbTk::Theme &theme, const std::string &name, const std::string &altname);
virtual ~TextTheme();
void update();
void setAntialias(bool value);
FbTk::Font &font() { return *m_font; }
const FbTk::Font &font() const { return *m_font; }
const FbTk::Color &textColor() const { return *m_text_color; }
FbTk::Justify justify() const { return *m_justify; }
GC textGC() const { return m_text_gc.gc(); }
private:
FbTk::ThemeItem<FbTk::Font> m_font;
FbTk::ThemeItem<FbTk::Color> m_text_color;
FbTk::ThemeItem<FbTk::Justify> m_justify;
FbTk::GContext m_text_gc;
};
#endif // TEXTTHEME_HH
| [
"mathias@54ec5f11-9ae8-0310-9a2b-99d706b22625"
] | mathias@54ec5f11-9ae8-0310-9a2b-99d706b22625 |
874321bdc8a14a697f40de99244b188dda2f4533 | fcfb2ac1bb54fdf754c3132f394b7babd1508d38 | /hooks/hooks.cpp | 99c0363e3d5b87923b7c4a6072b64555d316ef90 | [] | no_license | lw000/ffengine | ad3bc95c26efceae06cbcaa71a14aaea62dd16a1 | 6c038efcdf08c2395a9cb5e50aa8dc87de23695a | refs/heads/master | 2021-03-17T18:13:17.724802 | 2020-03-21T12:27:16 | 2020-03-21T12:27:16 | 247,007,833 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 216 | cpp | #include "hooks.h"
#include <iostream>
Functor checkMessage() {
return {
[](message_t* t) -> bool {
std::cout << "mid=" << t->mid << "sid=" << t->sid << "msg=" << t->msg << std::endl;
return true;
}
};
} | [
"373102227@qq.com"
] | 373102227@qq.com |
5cfd4c1136163acb2df48cf140cbb29942013d4f | a0e678cb9c9338e42f0c982ab57ccd36730c7b47 | /CPPKad12/CPPKad12S「ダブルディスパッチ」課題/Player.h | 506bf86879fe54a295e8a40e987830ab272f295e | [] | no_license | 2190214/ecc_2190214 | 5508a263794cbbb888f725a56979d66f5c2d1a3a | 49a276a407d23cfd9384aaa3f4f7747f73fb9b1c | refs/heads/master | 2020-12-15T20:13:47.020772 | 2020-01-22T09:12:40 | 2020-01-22T09:12:40 | 235,241,014 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 725 | h | #pragma once
#include <iostream>
#include <string>
using namespace std;
#include "Hand.h"
// 基底クラス
class BasePlayer
{
private:
string name;
public:
BasePlayer(string n) : name(n) {}
string getName() { return name; }
Hand* createHand()
{
return nullptr;
}
virtual void intro() = 0;
};
// ユーザー
class UserPlayer : public BasePlayer
{
public:
UserPlayer() : BasePlayer("あなた") {}
void intro() { cout << "あなたが操作するプレイヤーです!" << endl; }
};
// コンピュータ
class CompPlayer : public BasePlayer
{
public:
CompPlayer() : BasePlayer("コンピュータ") {}
void intro() { cout << "コンピュータが操作するプレイヤーです!" << endl; }
};
| [
"2190214@eay.jp"
] | 2190214@eay.jp |
6488eef5215c29c1bdb7a6b0654f8c878be39e1b | f9b3ceb37e35453f472265a5b9cdcd50210215cb | /Product/Product/Topcd.cpp | 073f3116685d2a9e44b4e77ecd080d0fbf6f14d8 | [] | no_license | ZhiningHe/PointCloud | be4eb57f443160da1af60fd2dd91a2749fc210df | 1f00fb047e9ed4aa8a066a7c269e584a79d9fe3c | refs/heads/master | 2020-04-18T23:29:11.865605 | 2019-05-16T07:43:48 | 2019-05-18T07:44:01 | 167,822,613 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,649 | cpp | #include <pcl/io/openni2_grabber.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/filters/passthrough.h>
#include <pcl/io/pcd_io.h>
#include <pcl/common/time.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/common/transforms.h>
#include <string>
#include <iostream>
#include <vector>
using namespace pcl;
using namespace std;
boost::mutex cloud_mutex;
pcl::PointCloud<pcl::PointXYZI>::ConstPtr cloud_global;
class SimpleOpenNIViewer
{
public:
SimpleOpenNIViewer() {}
void cloud_cb_(const pcl::PointCloud<pcl::PointXYZI>::ConstPtr &cloud)//实时打印
{
static unsigned count = 0;
static double last = pcl::getTime();
int n = 0;
if (++count == 30)
{
double now = pcl::getTime();
cout << "time is" << now << endl;
char filename[100];
sprintf(filename, "D:\\%d.pcd",n++);
pcl::io::savePCDFileASCII(filename, *cloud);
//隔一段时间存储一张pcd文件
count = 0;
}
}
//回调函数,回传收到的点云到run()函数里
void cloud_cb_(const pcl::PointCloud<pcl::PointXYZI>::ConstPtr &cloud, pcl::PointCloud<pcl::PointXYZI>::Ptr &cloud_out, bool* new_cloud_available_flag)
{
//锁住,不允许此段时间内,点云数据被修改
cloud_mutex.lock();
*cloud_out = *cloud;
*new_cloud_available_flag = true;
cloud_mutex.unlock();
}
//kinect读到的点云是在viewer.showCloud里是颠倒的,这个函数就是把它再颠倒过
pcl::PointCloud<pcl::PointXYZI>::Ptr upsideDown(const pcl::PointCloud<pcl::PointXYZI>::Ptr cloud_in) {
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud_transformed(new pcl::PointCloud<pcl::PointXYZI>);
Eigen::Matrix4f transform = Eigen::Matrix4f::Identity();
transform(1, 1) = -1;
transform(2, 2) = -1;
pcl::transformPointCloud(*cloud_in, *cloud_transformed, transform);
return cloud_transformed;
}
//突出中间的部分的点云
pcl::PointCloud<pcl::PointXYZI>::Ptr highlightMiddleArea(const pcl::PointCloud<pcl::PointXYZI>::Ptr &cloud_in) {
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud_out(new pcl::PointCloud<pcl::PointXYZI>);
pcl::PassThrough<pcl::PointXYZI> pt;
pcl::IndicesPtr reserve_indices(new std::vector <int>);
pcl::copyPointCloud(*cloud_in, *cloud_out);
pt.setInputCloud(cloud_in);
pt.setFilterFieldName("x");
//突出x方向上(-0.3,0.3)这个范围内的点云
pt.setFilterLimits(-0.3, 0.3);
pt.filter(*reserve_indices);
for (int i = 0; i < (*reserve_indices).size(); i++) {
cloud_out->points[(*reserve_indices)[i]].intensity = 10;
}
return cloud_out;
}
//代码的核心部分,整个流程都在这里
void run(boost::shared_ptr<pcl::visualization::CloudViewer> viewer)
{
bool new_cloud_available_flag = false;
pcl::Grabber* interface = new OpenNI2Grabber();//创建openni2采集对象(接口)
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud_out(new pcl::PointCloud<pcl::PointXYZI>);
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud_tmp(new pcl::PointCloud<pcl::PointXYZI>);
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud_toshow(new pcl::PointCloud<pcl::PointXYZI>);
//定义回调函数
boost::function<void(const pcl::PointCloud<pcl::PointXYZI>::ConstPtr&)> f =
boost::bind(&SimpleOpenNIViewer::cloud_cb_, this, _1, cloud_out, &new_cloud_available_flag);
boost::signals2::connection = interface->registerCallback(f);//注册回调函数(开始数据流)
//start()之后,点云数据源源不断的传到cloud_out
interface->start();
while (!viewer->wasStopped())
{
if (new_cloud_available_flag)
{//如果有新的点云获取
cloud_mutex.lock(); //锁住,不允许此段时间内,点云数据被修改
cloud_tmp = upsideDown(cloud_out);//颠倒点云,为了可视化
cloud_mutex.unlock();
cloud_toshow = highlightMiddleArea(cloud_tmp);
viewer->showCloud(cloud_toshow);//可视化点云
cloud_global = cloud_tmp; //传点云到keyboardEventOccured()里
new_cloud_available_flag = false;
}
}
interface->stop();
}
};
//回调函数,当键盘有输入时,被调用
void keyboardEventOccured(const pcl::visualization::KeyboardEvent &event, void *nothing) {
if (event.getKeySym() == "space" && event.keyDown()) {//当按下空格键时
cout << "Space is pressed => pointcloud saved as output.pcd" << endl;
pcl::io::savePCDFile("D://output.pcd", *cloud_global);
}
}
int main()
{
boost::shared_ptr<pcl::visualization::CloudViewer> viewer2(new pcl::visualization::CloudViewer("a viewer"));
//绑定可视化窗口和键盘事件的函数
viewer2->registerKeyboardCallback(keyboardEventOccured, (void*)NULL);
SimpleOpenNIViewer v;
v.run(viewer2);
return 0;
}
| [
"747230196@qq.com"
] | 747230196@qq.com |
b74857957e1a03f397ab803d3b4e55cedf1e4ebd | 34d19902e304983a365e47853fbeb5fd55f9e563 | /qt/app/sortalgorithm.cpp | 789493bcc3b1caa1978320dcb1ac1ebb515d2386 | [
"MIT"
] | permissive | kboniadi/European-Vacation-App | 94e405ff5031c0ca604a09b6324b814908067871 | 44c56059c0eff27b00fe540bc5c031a528ab1d16 | refs/heads/master | 2023-01-02T10:06:45.377026 | 2020-10-05T18:33:38 | 2020-10-05T18:33:38 | 291,846,943 | 0 | 0 | MIT | 2020-10-15T22:17:05 | 2020-08-31T23:29:43 | HTML | UTF-8 | C++ | false | false | 1,313 | cpp | #include "sortalgorithm.h"
void algorithm::sort(const QStringList &list, QStringList &sortedList)
{
// helper recursive function
sort(list, list.size(), sortedList);
}
#define distance(city1, city2) DBManager::instance()->GetDistances(city1, city2)
void algorithm::sort(QStringList list, int size, QStringList &sortList)
{
// base case
if (size == 0)
return;
// runs once and pushes the first cities from list to sortList
// note: this city always represents the starting city in the list
if (sortList.size() == 0) {
sortList.push_back(list.front());
list.pop_front();
size--;
// sub base case incase there is only one city in list
if (size == 0) return;
}
QString temp = list.front();
// always between most recently added city in sortList
int dist = distance(sortList.last(), temp);
// iterates through list and finds the shortest distance to last
// city in the sortList
for (int i = 0; i < size; i++) {
int sudoDistance = distance(sortList.last(), list.at(i));
if (sudoDistance < dist) {
dist = sudoDistance;
temp = list.at(i);
} else if (size == 1) {
temp = list.front();
break;
}
}
// addes the closest city to sortList and removes it from list
sortList.push_back(temp);
list.removeAll(temp);
return sort(list, size - 1, sortList);
}
#undef distance
| [
"kordbon1@gmail.com"
] | kordbon1@gmail.com |
aacf6184c8a8a67ef437dbd01e6aacd6eaf9a4aa | 0d091590e9f509c1eecf867a6ff7c039e4d8e830 | /src/1278.cpp | 05e2bda178a4648194d5acae64f833f0ed17f93b | [] | no_license | again1943/zoj-solution | f17242d304229cdfe87fe61fec9f97d8ea280df1 | caa6d7862103bdbfd156c22ea9b1eef57cb88888 | refs/heads/master | 2021-01-22T11:38:01.414703 | 2012-11-06T13:52:46 | 2012-11-06T13:52:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 544 | cpp | #include <utility>
#include <map>
#include <cstdio>
using namespace std;
int evaluate(int z, int i, int m, int l)
{
int order = 0;
map<int,int>repeat;
map<int,int>::iterator iter;
while ((iter = repeat.find(l))==repeat.end())
{
repeat.insert(make_pair(l,order++));
l = (z*l+i)%m;
}
return order-iter->second;
}
int main()
{
int z,i,m,l;
int test_case = 1;
while(scanf("%d%d%d%d",&z,&i,&m,&l)&&(z != 0 || i != 0 || m != 0 || l != 0 ))
printf("Case %d: %d\n",test_case++,evaluate(z,i,m,l));
return 0;
} | [
"mawei@ThinkPad-T400.(none)"
] | mawei@ThinkPad-T400.(none) |
4eded6dc5e5230ddd3fdb2fa9a4e127a7729bade | 204201d53fd444670dc23999e0de0862559512a2 | /DtFecha.cpp | e698e1bf26978f40c8097ac9878260c11501a77d | [] | no_license | cristian6aston/tenoinflab | 11de21f61cd719e00bc257529ec8829ff0ac27fb | 1f8904a82040f0a7ac8695ac470277931232152b | refs/heads/master | 2021-01-09T06:38:47.654553 | 2016-06-14T00:03:22 | 2016-06-14T00:03:22 | 61,076,866 | 0 | 1 | null | 2016-06-14T00:03:23 | 2016-06-13T23:39:02 | C++ | UTF-8 | C++ | false | false | 1,153 | cpp | #include <iostream>
#include <stdexcept>
#include "DtFecha.h"
using namespace std;
DtFecha::DtFecha() {
this->dia = 1;
this->mes = 1;
this->anio = 1900;
}
DtFecha::DtFecha(const DtFecha &Fecha){
this->dia = Fecha.dia;
this->mes = Fecha.mes;
this->anio = Fecha.anio;
}
DtFecha::DtFecha(const int dia, const int mes, const int anio){
if((dia > 31) || (dia < 1) || (mes > 12) || (mes < 1) || (anio < 1900)){
throw invalid_argument("Error: fecha invalida.");
}else {
this->dia = dia;
this->mes = mes;
this->anio = anio;
}
}
int DtFecha::getAnio() const{
return anio;
}
int DtFecha::getDia() const{
return dia;
}
int DtFecha::getMes() const{
return mes;
}
bool DtFecha::operator==(const DtFecha &fecha) const{
return((this->dia == fecha.dia) &&
(this->mes == fecha.mes) &&
(this->anio == fecha.anio));
}
bool DtFecha::operator>(const DtFecha& fecha) const{}
ostream& operator << (ostream &o,DtFecha &dtf) {
return o << dtf.getDia() << "/"
<< dtf.getMes() << "/"
<< dtf.getAnio();
}
DtFecha::~DtFecha() {
} | [
"cristian6aston@gmail.com"
] | cristian6aston@gmail.com |
e3d3d8a81b6378e6874b5148fa783dedad05bbc7 | 4c23be1a0ca76f68e7146f7d098e26c2bbfb2650 | /ic8h18/0.003/IC4H6Q2-II | b3cfe8f60849dae686d3d4c8c7ab8c24e052498e | [] | no_license | labsandy/OpenFOAM_workspace | a74b473903ddbd34b31dc93917e3719bc051e379 | 6e0193ad9dabd613acf40d6b3ec4c0536c90aed4 | refs/heads/master | 2022-02-25T02:36:04.164324 | 2019-08-23T02:27:16 | 2019-08-23T02:27:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 842 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.003";
object IC4H6Q2-II;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 9.68393e-09;
boundaryField
{
boundary
{
type empty;
}
}
// ************************************************************************* //
| [
"jfeatherstone123@gmail.com"
] | jfeatherstone123@gmail.com | |
9bc1baab63c8457379a8fca6e57d4fbaeca8bf27 | 556bc516271dfe48b13850d51a6f65dce425adc4 | /acm.timus.ru/1068. Sum/AC-1068-sum.cpp | 14c6e9aa62bd47b9df00b3affa064ccc4c0a601a | [] | no_license | nur-alam/Problem-Solving | 4fae30499b5dd802854b7efa0b702b3f173fa236 | b0db93d597142590010b60bfa2054409a6ca6754 | refs/heads/master | 2021-01-13T11:10:06.766089 | 2019-01-16T12:01:52 | 2019-01-16T12:01:52 | 77,365,261 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 222 | cpp | #include<cstdio>
int main(){
int n,sum=0;
scanf("%d",&n);
if(n>0){
sum=(n*(n+1))/2;
}
else
{
sum=((n*(n-1))/2)*(-1);
sum=sum+1;
}
printf("%d",sum);
return 0;
}
| [
"nuralam862@gmail.com"
] | nuralam862@gmail.com |
5ac6d6c5d79261c5782e2db22462e980419fef07 | 78d174578bccdbf2d71689258f3633b206676f7b | /PSU_zappy_2017/ai/include/Ai.hpp | ed443fdd93bc3bbf7041276fd58c1d5591d4953f | [] | no_license | jeremy9875/PSU_zappy_2017 | 9fe8167b21aa1cf1ede46c4ad4541d5e1e4f4466 | 5ae0571cf17c0be2ad3047c643cf0031c43f88f6 | refs/heads/master | 2020-03-25T18:22:47.864099 | 2018-08-08T14:39:13 | 2018-08-08T14:39:13 | 144,027,578 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 495 | hpp | /*
** EPITECH PROJECT, 2018
** Ai
** File description:
** zappy
*/
#ifndef AI_HPP_
# define AI_HPP_
# include <iostream>
# include <map>
# include "Player.hpp"
# include "Data.hpp"
# define _LOOK "Look"
# define _FORWARD "Forward"
# define _RIGHT "Right"
# define _LEFT "Left"
class Ai {
public:
Ai();
~Ai();
void GameLoop();
void setDeath();
void setPlayerData(Data *data);
bool _alive = true;
bool _connected = false;
std::map<int, std::string> FuncName;
};
#endif /* !AI_HPP_ */
| [
"jeremy.el-kaim@epitech.eu"
] | jeremy.el-kaim@epitech.eu |
2806b6ddfe8b9397430c8af073af3fba4bbe7460 | e22ae765b312d2ee090313e742415f7233bd7b34 | /cmake-2.8.0/cmake-2.8.0/Source/cmCTest.cxx | 6d21ab5690ac4fd153e711a530153587d80e4ec8 | [
"BSD-3-Clause"
] | permissive | basson86/ASBR-CPP-2010 | 3a979e8e1c956d2281a24c25457178410a9d0ba8 | 10cd73db602bd908790f0c77b758eff9a94b3257 | refs/heads/master | 2021-03-12T19:56:39.076324 | 2015-05-26T03:45:11 | 2015-05-26T03:45:11 | 35,295,227 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 80,198 | cxx | /*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#include "cm_curl.h"
#include "cmCTest.h"
#include "cmake.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include <cmsys/Directory.hxx>
#include <cmsys/SystemInformation.hxx>
#include "cmDynamicLoader.h"
#include "cmGeneratedFileStream.h"
#include "cmXMLSafe.h"
#include "cmVersionMacros.h"
#include "cmCTestCommand.h"
#include "cmCTestBuildHandler.h"
#include "cmCTestBuildAndTestHandler.h"
#include "cmCTestConfigureHandler.h"
#include "cmCTestCoverageHandler.h"
#include "cmCTestMemCheckHandler.h"
#include "cmCTestScriptHandler.h"
#include "cmCTestTestHandler.h"
#include "cmCTestUpdateHandler.h"
#include "cmCTestSubmitHandler.h"
#include "cmVersion.h"
#include <cmsys/RegularExpression.hxx>
#include <cmsys/Process.h>
#include <cmsys/Glob.hxx>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <ctype.h>
#include <memory> // auto_ptr
#if defined(__BEOS__) && !defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
#endif
#if defined(__HAIKU__)
#include <os/kernel/OS.h> /* disable_debugger() API. */
#endif
#define DEBUGOUT std::cout << __LINE__ << " "; std::cout
#define DEBUGERR std::cerr << __LINE__ << " "; std::cerr
//----------------------------------------------------------------------
struct tm* cmCTest::GetNightlyTime(std::string str,
bool tomorrowtag)
{
struct tm* lctime;
time_t tctime = time(0);
lctime = gmtime(&tctime);
char buf[1024];
// add todays year day and month to the time in str because
// curl_getdate no longer assumes the day is today
sprintf(buf, "%d%02d%02d %s",
lctime->tm_year+1900,
lctime->tm_mon +1,
lctime->tm_mday,
str.c_str());
cmCTestLog(this, OUTPUT, "Determine Nightly Start Time" << std::endl
<< " Specified time: " << str.c_str() << std::endl);
//Convert the nightly start time to seconds. Since we are
//providing only a time and a timezone, the current date of
//the local machine is assumed. Consequently, nightlySeconds
//is the time at which the nightly dashboard was opened or
//will be opened on the date of the current client machine.
//As such, this time may be in the past or in the future.
time_t ntime = curl_getdate(buf, &tctime);
cmCTestLog(this, DEBUG, " Get curl time: " << ntime << std::endl);
tctime = time(0);
cmCTestLog(this, DEBUG, " Get the current time: " << tctime << std::endl);
const int dayLength = 24 * 60 * 60;
cmCTestLog(this, DEBUG, "Seconds: " << tctime << std::endl);
while ( ntime > tctime )
{
// If nightlySeconds is in the past, this is the current
// open dashboard, then return nightlySeconds. If
// nightlySeconds is in the future, this is the next
// dashboard to be opened, so subtract 24 hours to get the
// time of the current open dashboard
ntime -= dayLength;
cmCTestLog(this, DEBUG, "Pick yesterday" << std::endl);
cmCTestLog(this, DEBUG, " Future time, subtract day: " << ntime
<< std::endl);
}
while ( tctime > (ntime + dayLength) )
{
ntime += dayLength;
cmCTestLog(this, DEBUG, " Past time, add day: " << ntime << std::endl);
}
cmCTestLog(this, DEBUG, "nightlySeconds: " << ntime << std::endl);
cmCTestLog(this, DEBUG, " Current time: " << tctime
<< " Nightly time: " << ntime << std::endl);
if ( tomorrowtag )
{
cmCTestLog(this, OUTPUT, " Use future tag, Add a day" << std::endl);
ntime += dayLength;
}
lctime = gmtime(&ntime);
return lctime;
}
//----------------------------------------------------------------------
std::string cmCTest::CleanString(const std::string& str)
{
std::string::size_type spos = str.find_first_not_of(" \n\t\r\f\v");
std::string::size_type epos = str.find_last_not_of(" \n\t\r\f\v");
if ( spos == str.npos )
{
return std::string();
}
if ( epos != str.npos )
{
epos = epos - spos + 1;
}
return str.substr(spos, epos);
}
//----------------------------------------------------------------------
std::string cmCTest::CurrentTime()
{
time_t currenttime = time(0);
struct tm* t = localtime(¤ttime);
//return ::CleanString(ctime(¤ttime));
char current_time[1024];
if ( this->ShortDateFormat )
{
strftime(current_time, 1000, "%b %d %H:%M %Z", t);
}
else
{
strftime(current_time, 1000, "%a %b %d %H:%M:%S %Z %Y", t);
}
cmCTestLog(this, DEBUG, " Current_Time: " << current_time << std::endl);
return cmXMLSafe(cmCTest::CleanString(current_time)).str();
}
//----------------------------------------------------------------------
std::string cmCTest::MakeURLSafe(const std::string& str)
{
cmOStringStream ost;
char buffer[10];
for ( std::string::size_type pos = 0; pos < str.size(); pos ++ )
{
unsigned char ch = str[pos];
if ( ( ch > 126 || ch < 32 ||
ch == '&' ||
ch == '%' ||
ch == '+' ||
ch == '=' ||
ch == '@'
) && ch != 9 )
{
sprintf(buffer, "%02x;", (unsigned int)ch);
ost << buffer;
}
else
{
ost << ch;
}
}
return ost.str();
}
//----------------------------------------------------------------------------
std::string cmCTest::DecodeURL(const std::string& in)
{
std::string out;
for(const char* c = in.c_str(); *c; ++c)
{
if(*c == '%' && isxdigit(*(c+1)) && isxdigit(*(c+2)))
{
char buf[3] = {*(c+1), *(c+2), 0};
out.append(1, char(strtoul(buf, 0, 16)));
c += 2;
}
else
{
out.append(1, *c);
}
}
return out;
}
//----------------------------------------------------------------------
cmCTest::cmCTest()
{
this->LabelSummary = true;
this->ParallelLevel = 1;
this->SubmitIndex = 0;
this->Failover = false;
this->BatchJobs = false;
this->ForceNewCTestProcess = false;
this->TomorrowTag = false;
this->Verbose = false;
this->Debug = false;
this->ShowLineNumbers = false;
this->Quiet = false;
this->ExtraVerbose = false;
this->ProduceXML = false;
this->ShowOnly = false;
this->RunConfigurationScript = false;
this->TestModel = cmCTest::EXPERIMENTAL;
this->MaxTestNameWidth = 30;
this->InteractiveDebugMode = true;
this->TimeOut = 0;
this->CompressXMLFiles = false;
this->CTestConfigFile = "";
this->OutputLogFile = 0;
this->OutputLogFileLastTag = -1;
this->SuppressUpdatingCTestConfiguration = false;
this->DartVersion = 1;
this->OutputTestOutputOnTestFailure = false;
if(cmSystemTools::GetEnv("CTEST_OUTPUT_ON_FAILURE"))
{
this->OutputTestOutputOnTestFailure = true;
}
this->InitStreams();
this->Parts[PartStart].SetName("Start");
this->Parts[PartUpdate].SetName("Update");
this->Parts[PartConfigure].SetName("Configure");
this->Parts[PartBuild].SetName("Build");
this->Parts[PartTest].SetName("Test");
this->Parts[PartCoverage].SetName("Coverage");
this->Parts[PartMemCheck].SetName("MemCheck");
this->Parts[PartSubmit].SetName("Submit");
this->Parts[PartNotes].SetName("Notes");
this->Parts[PartExtraFiles].SetName("ExtraFiles");
// Fill the part name-to-id map.
for(Part p = PartStart; p != PartCount; p = Part(p+1))
{
this->PartMap[cmSystemTools::LowerCase(this->Parts[p].GetName())] = p;
}
this->ShortDateFormat = true;
this->TestingHandlers["build"] = new cmCTestBuildHandler;
this->TestingHandlers["buildtest"] = new cmCTestBuildAndTestHandler;
this->TestingHandlers["coverage"] = new cmCTestCoverageHandler;
this->TestingHandlers["script"] = new cmCTestScriptHandler;
this->TestingHandlers["test"] = new cmCTestTestHandler;
this->TestingHandlers["update"] = new cmCTestUpdateHandler;
this->TestingHandlers["configure"] = new cmCTestConfigureHandler;
this->TestingHandlers["memcheck"] = new cmCTestMemCheckHandler;
this->TestingHandlers["submit"] = new cmCTestSubmitHandler;
cmCTest::t_TestingHandlers::iterator it;
for ( it = this->TestingHandlers.begin();
it != this->TestingHandlers.end(); ++ it )
{
it->second->SetCTestInstance(this);
}
// Make sure we can capture the build tool output.
cmSystemTools::EnableVSConsoleOutput();
}
//----------------------------------------------------------------------
cmCTest::~cmCTest()
{
cmCTest::t_TestingHandlers::iterator it;
for ( it = this->TestingHandlers.begin();
it != this->TestingHandlers.end(); ++ it )
{
delete it->second;
it->second = 0;
}
this->SetOutputLogFileName(0);
}
void cmCTest::SetParallelLevel(int level)
{
this->ParallelLevel = level < 1 ? 1 : level;
}
//----------------------------------------------------------------------------
cmCTest::Part cmCTest::GetPartFromName(const char* name)
{
// Look up by lower-case to make names case-insensitive.
std::string lower_name = cmSystemTools::LowerCase(name);
PartMapType::const_iterator i = this->PartMap.find(lower_name);
if(i != this->PartMap.end())
{
return i->second;
}
// The string does not name a valid part.
return PartCount;
}
//----------------------------------------------------------------------
int cmCTest::Initialize(const char* binary_dir, bool new_tag,
bool verbose_tag)
{
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
if(!this->InteractiveDebugMode)
{
this->BlockTestErrorDiagnostics();
}
else
{
cmSystemTools::PutEnv("CTEST_INTERACTIVE_DEBUG_MODE=1");
}
this->BinaryDir = binary_dir;
cmSystemTools::ConvertToUnixSlashes(this->BinaryDir);
this->UpdateCTestConfiguration();
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
if ( this->ProduceXML )
{
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
cmCTestLog(this, OUTPUT,
" Site: " << this->GetCTestConfiguration("Site") << std::endl
<< " Build name: " << this->GetCTestConfiguration("BuildName")
<< std::endl);
cmCTestLog(this, DEBUG, "Produce XML is on" << std::endl);
if ( this->TestModel == cmCTest::NIGHTLY &&
this->GetCTestConfiguration("NightlyStartTime").empty() )
{
cmCTestLog(this, WARNING,
"WARNING: No nightly start time found please set in"
" CTestConfig.cmake or DartConfig.cmake" << std::endl);
cmCTestLog(this, DEBUG, "Here: " << __LINE__ << std::endl);
return 0;
}
}
cmake cm;
cmGlobalGenerator gg;
gg.SetCMakeInstance(&cm);
std::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
cmMakefile *mf = lg->GetMakefile();
if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf) )
{
cmCTestLog(this, DEBUG, "Cannot find custom configuration file tree"
<< std::endl);
return 0;
}
if ( this->ProduceXML )
{
std::string testingDir = this->BinaryDir + "/Testing";
if ( cmSystemTools::FileExists(testingDir.c_str()) )
{
if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) )
{
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
<< " is in the place of the testing directory" << std::endl);
return 0;
}
}
else
{
if ( !cmSystemTools::MakeDirectory(testingDir.c_str()) )
{
cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory "
<< testingDir << std::endl);
return 0;
}
}
std::string tagfile = testingDir + "/TAG";
std::ifstream tfin(tagfile.c_str());
std::string tag;
time_t tctime = time(0);
if ( this->TomorrowTag )
{
tctime += ( 24 * 60 * 60 );
}
struct tm *lctime = gmtime(&tctime);
if ( tfin && cmSystemTools::GetLineFromStream(tfin, tag) )
{
int year = 0;
int mon = 0;
int day = 0;
int hour = 0;
int min = 0;
sscanf(tag.c_str(), "%04d%02d%02d-%02d%02d",
&year, &mon, &day, &hour, &min);
if ( year != lctime->tm_year + 1900 ||
mon != lctime->tm_mon+1 ||
day != lctime->tm_mday )
{
tag = "";
}
std::string tagmode;
if ( cmSystemTools::GetLineFromStream(tfin, tagmode) )
{
if (tagmode.size() > 4 && !this->Parts[PartStart])
{
this->TestModel = cmCTest::GetTestModelFromString(tagmode.c_str());
}
}
tfin.close();
}
if (tag.size() == 0 || new_tag || this->Parts[PartStart])
{
cmCTestLog(this, DEBUG, "TestModel: " << this->GetTestModelString()
<< std::endl);
cmCTestLog(this, DEBUG, "TestModel: " << this->TestModel << std::endl);
if ( this->TestModel == cmCTest::NIGHTLY )
{
lctime = this->GetNightlyTime(
this->GetCTestConfiguration("NightlyStartTime"), this->TomorrowTag);
}
char datestring[100];
sprintf(datestring, "%04d%02d%02d-%02d%02d",
lctime->tm_year + 1900,
lctime->tm_mon+1,
lctime->tm_mday,
lctime->tm_hour,
lctime->tm_min);
tag = datestring;
std::ofstream ofs(tagfile.c_str());
if ( ofs )
{
ofs << tag << std::endl;
ofs << this->GetTestModelString() << std::endl;
}
ofs.close();
if ( verbose_tag )
{
cmCTestLog(this, OUTPUT, "Create new tag: " << tag << " - "
<< this->GetTestModelString() << std::endl);
}
}
this->CurrentTag = tag;
}
return 1;
}
//----------------------------------------------------------------------
bool cmCTest::InitializeFromCommand(cmCTestCommand* command, bool first)
{
if ( !first && !this->CurrentTag.empty() )
{
return true;
}
std::string src_dir
= this->GetCTestConfiguration("SourceDirectory").c_str();
std::string bld_dir = this->GetCTestConfiguration("BuildDirectory").c_str();
this->DartVersion = 1;
for(Part p = PartStart; p != PartCount; p = Part(p+1))
{
this->Parts[p].SubmitFiles.clear();
}
cmMakefile* mf = command->GetMakefile();
std::string fname = src_dir;
fname += "/CTestConfig.cmake";
cmSystemTools::ConvertToUnixSlashes(fname);
if ( cmSystemTools::FileExists(fname.c_str()) )
{
cmCTestLog(this, OUTPUT, " Reading ctest configuration file: "
<< fname.c_str() << std::endl);
bool readit = mf->ReadListFile(mf->GetCurrentListFile(),
fname.c_str() );
if(!readit)
{
std::string m = "Could not find include file: ";
m += fname;
command->SetError(m.c_str());
return false;
}
}
else if ( !first )
{
cmCTestLog(this, WARNING, "Cannot locate CTest configuration: "
<< fname.c_str() << std::endl);
}
else
{
cmCTestLog(this, HANDLER_OUTPUT, " Cannot locate CTest configuration: "
<< fname.c_str() << std::endl
<< " Delay the initialization of CTest" << std::endl);
}
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",
"CTEST_NIGHTLY_START_TIME");
this->SetCTestConfigurationFromCMakeVariable(mf, "Site", "CTEST_SITE");
this->SetCTestConfigurationFromCMakeVariable(mf, "BuildName",
"CTEST_BUILD_NAME");
const char* dartVersion = mf->GetDefinition("CTEST_DART_SERVER_VERSION");
if ( dartVersion )
{
this->DartVersion = atoi(dartVersion);
if ( this->DartVersion < 0 )
{
cmCTestLog(this, ERROR_MESSAGE, "Invalid Dart server version: "
<< dartVersion << ". Please specify the version number."
<< std::endl);
return false;
}
}
if ( !this->Initialize(bld_dir.c_str(), true, false) )
{
if ( this->GetCTestConfiguration("NightlyStartTime").empty() && first)
{
return true;
}
return false;
}
cmCTestLog(this, OUTPUT, " Use " << this->GetTestModelString()
<< " tag: " << this->GetCurrentTag() << std::endl);
return true;
}
//----------------------------------------------------------------------
bool cmCTest::UpdateCTestConfiguration()
{
if ( this->SuppressUpdatingCTestConfiguration )
{
return true;
}
std::string fileName = this->CTestConfigFile;
if ( fileName.empty() )
{
fileName = this->BinaryDir + "/CTestConfiguration.ini";
if ( !cmSystemTools::FileExists(fileName.c_str()) )
{
fileName = this->BinaryDir + "/DartConfiguration.tcl";
}
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "UpdateCTestConfiguration from :"
<< fileName.c_str() << "\n");
if ( !cmSystemTools::FileExists(fileName.c_str()) )
{
// No need to exit if we are not producing XML
if ( this->ProduceXML )
{
cmCTestLog(this, ERROR_MESSAGE, "Cannot find file: " << fileName.c_str()
<< std::endl);
return false;
}
}
else
{
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:"
<< fileName.c_str() << "\n");
// parse the dart test file
std::ifstream fin(fileName.c_str());
if(!fin)
{
return false;
}
char buffer[1024];
while ( fin )
{
buffer[0] = 0;
fin.getline(buffer, 1023);
buffer[1023] = 0;
std::string line = cmCTest::CleanString(buffer);
if(line.size() == 0)
{
continue;
}
while ( fin && (line[line.size()-1] == '\\') )
{
line = line.substr(0, line.size()-1);
buffer[0] = 0;
fin.getline(buffer, 1023);
buffer[1023] = 0;
line += cmCTest::CleanString(buffer);
}
if ( line[0] == '#' )
{
continue;
}
std::string::size_type cpos = line.find_first_of(":");
if ( cpos == line.npos )
{
continue;
}
std::string key = line.substr(0, cpos);
std::string value
= cmCTest::CleanString(line.substr(cpos+1, line.npos));
this->CTestConfiguration[key] = value;
}
fin.close();
}
if ( !this->GetCTestConfiguration("BuildDirectory").empty() )
{
this->BinaryDir = this->GetCTestConfiguration("BuildDirectory");
cmSystemTools::ChangeDirectory(this->BinaryDir.c_str());
}
this->TimeOut = atoi(this->GetCTestConfiguration("TimeOut").c_str());
if ( this->ProduceXML )
{
this->CompressXMLFiles = cmSystemTools::IsOn(
this->GetCTestConfiguration("CompressSubmission").c_str());
}
return true;
}
//----------------------------------------------------------------------
void cmCTest::BlockTestErrorDiagnostics()
{
cmSystemTools::PutEnv("DART_TEST_FROM_DART=1");
cmSystemTools::PutEnv("DASHBOARD_TEST_FROM_CTEST=" CMake_VERSION);
#if defined(_WIN32)
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
#elif defined(__BEOS__) || defined(__HAIKU__)
disable_debugger(1);
#endif
}
//----------------------------------------------------------------------
void cmCTest::SetTestModel(int mode)
{
this->InteractiveDebugMode = false;
this->TestModel = mode;
}
//----------------------------------------------------------------------
bool cmCTest::SetTest(const char* ttype, bool report)
{
if ( cmSystemTools::LowerCase(ttype) == "all" )
{
for(Part p = PartStart; p != PartCount; p = Part(p+1))
{
this->Parts[p].Enable();
}
return true;
}
Part p = this->GetPartFromName(ttype);
if(p != PartCount)
{
this->Parts[p].Enable();
return true;
}
else
{
if ( report )
{
cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \"" << ttype
<< "\" yet..." << std::endl);
}
return false;
}
}
//----------------------------------------------------------------------
void cmCTest::Finalize()
{
}
//----------------------------------------------------------------------
bool cmCTest::OpenOutputFile(const std::string& path,
const std::string& name, cmGeneratedFileStream& stream,
bool compress)
{
std::string testingDir = this->BinaryDir + "/Testing";
if ( path.size() > 0 )
{
testingDir += "/" + path;
}
if ( cmSystemTools::FileExists(testingDir.c_str()) )
{
if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) )
{
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
<< " is in the place of the testing directory"
<< std::endl);
return false;
}
}
else
{
if ( !cmSystemTools::MakeDirectory(testingDir.c_str()) )
{
cmCTestLog(this, ERROR_MESSAGE, "Cannot create directory " << testingDir
<< std::endl);
return false;
}
}
std::string filename = testingDir + "/" + name;
stream.Open(filename.c_str());
if( !stream )
{
cmCTestLog(this, ERROR_MESSAGE, "Problem opening file: " << filename
<< std::endl);
return false;
}
if ( compress )
{
if ( this->CompressXMLFiles )
{
stream.SetCompression(true);
}
}
return true;
}
//----------------------------------------------------------------------
bool cmCTest::AddIfExists(Part part, const char* file)
{
if ( this->CTestFileExists(file) )
{
this->AddSubmitFile(part, file);
}
else
{
std::string name = file;
name += ".gz";
if ( this->CTestFileExists(name.c_str()) )
{
this->AddSubmitFile(part, file);
}
else
{
return false;
}
}
return true;
}
//----------------------------------------------------------------------
bool cmCTest::CTestFileExists(const std::string& filename)
{
std::string testingDir = this->BinaryDir + "/Testing/" +
this->CurrentTag + "/" + filename;
return cmSystemTools::FileExists(testingDir.c_str());
}
//----------------------------------------------------------------------
cmCTestGenericHandler* cmCTest::GetInitializedHandler(const char* handler)
{
cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if ( it == this->TestingHandlers.end() )
{
return 0;
}
it->second->Initialize();
return it->second;
}
//----------------------------------------------------------------------
cmCTestGenericHandler* cmCTest::GetHandler(const char* handler)
{
cmCTest::t_TestingHandlers::iterator it =
this->TestingHandlers.find(handler);
if ( it == this->TestingHandlers.end() )
{
return 0;
}
return it->second;
}
//----------------------------------------------------------------------
int cmCTest::ExecuteHandler(const char* shandler)
{
cmCTestGenericHandler* handler = this->GetHandler(shandler);
if ( !handler )
{
return -1;
}
handler->Initialize();
return handler->ProcessHandler();
}
//----------------------------------------------------------------------
int cmCTest::ProcessTests()
{
int res = 0;
bool notest = true;
int update_count = 0;
for(Part p = PartStart; notest && p != PartCount; p = Part(p+1))
{
notest = !this->Parts[p];
}
if (this->Parts[PartUpdate] &&
(this->GetRemainingTimeAllowed() - 120 > 0))
{
cmCTestGenericHandler* uphandler = this->GetHandler("update");
uphandler->SetPersistentOption("SourceDirectory",
this->GetCTestConfiguration("SourceDirectory").c_str());
update_count = uphandler->ProcessHandler();
if ( update_count < 0 )
{
res |= cmCTest::UPDATE_ERRORS;
}
}
if ( this->TestModel == cmCTest::CONTINUOUS && !update_count )
{
return 0;
}
if (this->Parts[PartConfigure] &&
(this->GetRemainingTimeAllowed() - 120 > 0))
{
if (this->GetHandler("configure")->ProcessHandler() < 0)
{
res |= cmCTest::CONFIGURE_ERRORS;
}
}
if (this->Parts[PartBuild] &&
(this->GetRemainingTimeAllowed() - 120 > 0))
{
this->UpdateCTestConfiguration();
if (this->GetHandler("build")->ProcessHandler() < 0)
{
res |= cmCTest::BUILD_ERRORS;
}
}
if ((this->Parts[PartTest] || notest) &&
(this->GetRemainingTimeAllowed() - 120 > 0))
{
this->UpdateCTestConfiguration();
if (this->GetHandler("test")->ProcessHandler() < 0)
{
res |= cmCTest::TEST_ERRORS;
}
}
if (this->Parts[PartCoverage] &&
(this->GetRemainingTimeAllowed() - 120 > 0))
{
this->UpdateCTestConfiguration();
if (this->GetHandler("coverage")->ProcessHandler() < 0)
{
res |= cmCTest::COVERAGE_ERRORS;
}
}
if (this->Parts[PartMemCheck] &&
(this->GetRemainingTimeAllowed() - 120 > 0))
{
this->UpdateCTestConfiguration();
if (this->GetHandler("memcheck")->ProcessHandler() < 0)
{
res |= cmCTest::MEMORY_ERRORS;
}
}
if ( !notest )
{
std::string notes_dir = this->BinaryDir + "/Testing/Notes";
if ( cmSystemTools::FileIsDirectory(notes_dir.c_str()) )
{
cmsys::Directory d;
d.Load(notes_dir.c_str());
unsigned long kk;
for ( kk = 0; kk < d.GetNumberOfFiles(); kk ++ )
{
const char* file = d.GetFile(kk);
std::string fullname = notes_dir + "/" + file;
if ( cmSystemTools::FileExists(fullname.c_str()) &&
!cmSystemTools::FileIsDirectory(fullname.c_str()) )
{
if ( this->NotesFiles.size() > 0 )
{
this->NotesFiles += ";";
}
this->NotesFiles += fullname;
this->Parts[PartNotes].Enable();
}
}
}
}
if (this->Parts[PartNotes])
{
this->UpdateCTestConfiguration();
if ( this->NotesFiles.size() )
{
this->GenerateNotesFile(this->NotesFiles.c_str());
}
}
if (this->Parts[PartSubmit])
{
this->UpdateCTestConfiguration();
if (this->GetHandler("submit")->ProcessHandler() < 0)
{
res |= cmCTest::SUBMIT_ERRORS;
}
}
if ( res != 0 )
{
cmCTestLog(this, ERROR_MESSAGE, "Errors while running CTest"
<< std::endl);
}
return res;
}
//----------------------------------------------------------------------
std::string cmCTest::GetTestModelString()
{
if ( !this->SpecificTrack.empty() )
{
return this->SpecificTrack;
}
switch ( this->TestModel )
{
case cmCTest::NIGHTLY:
return "Nightly";
case cmCTest::CONTINUOUS:
return "Continuous";
}
return "Experimental";
}
//----------------------------------------------------------------------
int cmCTest::GetTestModelFromString(const char* str)
{
if ( !str )
{
return cmCTest::EXPERIMENTAL;
}
std::string rstr = cmSystemTools::LowerCase(str);
if ( strncmp(rstr.c_str(), "cont", 4) == 0 )
{
return cmCTest::CONTINUOUS;
}
if ( strncmp(rstr.c_str(), "nigh", 4) == 0 )
{
return cmCTest::NIGHTLY;
}
return cmCTest::EXPERIMENTAL;
}
//######################################################################
//######################################################################
//######################################################################
//######################################################################
//----------------------------------------------------------------------
int cmCTest::RunMakeCommand(const char* command, std::string* output,
int* retVal, const char* dir, int timeout, std::ofstream& ofs)
{
// First generate the command and arguments
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
if(args.size() < 1)
{
return false;
}
std::vector<const char*> argv;
for(std::vector<cmStdString>::const_iterator a = args.begin();
a != args.end(); ++a)
{
argv.push_back(a->c_str());
}
argv.push_back(0);
if ( output )
{
*output = "";
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:");
std::vector<const char*>::iterator ait;
for ( ait = argv.begin(); ait != argv.end() && *ait; ++ ait )
{
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, " \"" << *ait << "\"");
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, std::endl);
// Now create process object
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetCommand(cp, &*argv.begin());
cmsysProcess_SetWorkingDirectory(cp, dir);
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
cmsysProcess_SetTimeout(cp, timeout);
cmsysProcess_Execute(cp);
// Initialize tick's
std::string::size_type tick = 0;
std::string::size_type tick_len = 1024;
std::string::size_type tick_line_len = 50;
char* data;
int length;
cmCTestLog(this, HANDLER_OUTPUT,
" Each . represents " << tick_len << " bytes of output" << std::endl
<< " " << std::flush);
while(cmsysProcess_WaitForData(cp, &data, &length, 0))
{
if ( output )
{
for(int cc =0; cc < length; ++cc)
{
if(data[cc] == 0)
{
data[cc] = '\n';
}
}
output->append(data, length);
while ( output->size() > (tick * tick_len) )
{
tick ++;
cmCTestLog(this, HANDLER_OUTPUT, "." << std::flush);
if ( tick % tick_line_len == 0 && tick > 0 )
{
cmCTestLog(this, HANDLER_OUTPUT, " Size: "
<< int((output->size() / 1024.0) + 1) << "K" << std::endl
<< " " << std::flush);
}
}
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, cmCTestLogWrite(data, length));
if ( ofs )
{
ofs << cmCTestLogWrite(data, length);
}
}
cmCTestLog(this, OUTPUT, " Size of output: "
<< int(output->size() / 1024.0) << "K" << std::endl);
cmsysProcess_WaitForExit(cp, 0);
int result = cmsysProcess_GetState(cp);
if(result == cmsysProcess_State_Exited)
{
*retVal = cmsysProcess_GetExitValue(cp);
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Command exited with the value: "
<< *retVal << std::endl);
}
else if(result == cmsysProcess_State_Exception)
{
*retVal = cmsysProcess_GetExitException(cp);
cmCTestLog(this, WARNING, "There was an exception: " << *retVal
<< std::endl);
}
else if(result == cmsysProcess_State_Expired)
{
cmCTestLog(this, WARNING, "There was a timeout" << std::endl);
}
else if(result == cmsysProcess_State_Error)
{
*output += "\n*** ERROR executing: ";
*output += cmsysProcess_GetErrorString(cp);
*output += "\n***The build process failed.";
cmCTestLog(this, ERROR_MESSAGE, "There was an error: "
<< cmsysProcess_GetErrorString(cp) << std::endl);
}
cmsysProcess_Delete(cp);
return result;
}
//######################################################################
//######################################################################
//######################################################################
//######################################################################
//----------------------------------------------------------------------
int cmCTest::RunTest(std::vector<const char*> argv,
std::string* output, int *retVal,
std::ostream* log, double testTimeOut,
std::vector<std::string>* environment)
{
std::vector<std::string> origEnv;
bool modifyEnv = (environment && environment->size()>0);
// determine how much time we have
double timeout = this->GetRemainingTimeAllowed() - 120;
if (this->TimeOut > 0 && this->TimeOut < timeout)
{
timeout = this->TimeOut;
}
if (testTimeOut > 0
&& testTimeOut < this->GetRemainingTimeAllowed())
{
timeout = testTimeOut;
}
// always have at least 1 second if we got to here
if (timeout <= 0)
{
timeout = 1;
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"Test timeout computed to be: " << timeout << "\n");
if(cmSystemTools::SameFile(argv[0], this->CTestSelf.c_str()) &&
!this->ForceNewCTestProcess)
{
cmCTest inst;
inst.ConfigType = this->ConfigType;
inst.TimeOut = timeout;
// Capture output of the child ctest.
cmOStringStream oss;
inst.SetStreams(&oss, &oss);
std::vector<std::string> args;
for(unsigned int i =0; i < argv.size(); ++i)
{
if(argv[i])
{
// make sure we pass the timeout in for any build and test
// invocations. Since --build-generator is required this is a
// good place to check for it, and to add the arguments in
if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0)
{
args.push_back("--test-timeout");
cmOStringStream msg;
msg << timeout;
args.push_back(msg.str());
}
args.push_back(argv[i]);
}
}
if ( log )
{
*log << "* Run internal CTest" << std::endl;
}
std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
if (modifyEnv)
{
origEnv = cmSystemTools::AppendEnv(environment);
}
*retVal = inst.Run(args, output);
*output += oss.str();
if ( log )
{
*log << output->c_str();
}
cmSystemTools::ChangeDirectory(oldpath.c_str());
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"Internal cmCTest object used to run test." << std::endl
<< *output << std::endl);
if (modifyEnv)
{
cmSystemTools::RestoreEnv(origEnv);
}
return cmsysProcess_State_Exited;
}
std::vector<char> tempOutput;
if ( output )
{
*output = "";
}
if (modifyEnv)
{
origEnv = cmSystemTools::AppendEnv(environment);
}
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetCommand(cp, &*argv.begin());
cmCTestLog(this, DEBUG, "Command is: " << argv[0] << std::endl);
if(cmSystemTools::GetRunCommandHideConsole())
{
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
}
cmsysProcess_SetTimeout(cp, timeout);
cmsysProcess_Execute(cp);
char* data;
int length;
while(cmsysProcess_WaitForData(cp, &data, &length, 0))
{
if ( output )
{
tempOutput.insert(tempOutput.end(), data, data+length);
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, cmCTestLogWrite(data, length));
if ( log )
{
log->write(data, length);
}
}
cmsysProcess_WaitForExit(cp, 0);
if(output && tempOutput.begin() != tempOutput.end())
{
output->append(&*tempOutput.begin(), tempOutput.size());
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- Process completed"
<< std::endl);
int result = cmsysProcess_GetState(cp);
if(result == cmsysProcess_State_Exited)
{
*retVal = cmsysProcess_GetExitValue(cp);
if(*retVal != 0 && this->OutputTestOutputOnTestFailure)
{
OutputTestErrors(tempOutput);
}
}
else if(result == cmsysProcess_State_Exception)
{
if(this->OutputTestOutputOnTestFailure)
{
OutputTestErrors(tempOutput);
}
*retVal = cmsysProcess_GetExitException(cp);
std::string outerr = "\n*** Exception executing: ";
outerr += cmsysProcess_GetExceptionString(cp);
*output += outerr;
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl
<< std::flush);
}
else if(result == cmsysProcess_State_Error)
{
std::string outerr = "\n*** ERROR executing: ";
outerr += cmsysProcess_GetErrorString(cp);
*output += outerr;
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl
<< std::flush);
}
cmsysProcess_Delete(cp);
if (modifyEnv)
{
cmSystemTools::RestoreEnv(origEnv);
}
return result;
}
//----------------------------------------------------------------------
void cmCTest::StartXML(std::ostream& ostr, bool append)
{
if(this->CurrentTag.empty())
{
cmCTestLog(this, ERROR_MESSAGE,
"Current Tag empty, this may mean"
" NightlStartTime was not set correctly." << std::endl);
cmSystemTools::SetFatalErrorOccured();
}
// find out about the system
cmsys::SystemInformation info;
info.RunCPUCheck();
info.RunOSCheck();
info.RunMemoryCheck();
ostr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
<< "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName")
<< "\"\n\tBuildStamp=\"" << this->CurrentTag << "-"
<< this->GetTestModelString() << "\"\n\tName=\""
<< this->GetCTestConfiguration("Site") << "\"\n\tGenerator=\"ctest-"
<< cmVersion::GetCMakeVersion() << "\"\n"
<< (append? "\tAppend=\"true\"\n":"")
<< "\tCompilerName=\"" << this->GetCTestConfiguration("Compiler")
<< "\"\n"
#ifdef _COMPILER_VERSION
<< "\tCompilerVersion=\"_COMPILER_VERSION\"\n"
#endif
<< "\tOSName=\"" << info.GetOSName() << "\"\n"
<< "\tHostname=\"" << info.GetHostname() << "\"\n"
<< "\tOSRelease=\"" << info.GetOSRelease() << "\"\n"
<< "\tOSVersion=\"" << info.GetOSVersion() << "\"\n"
<< "\tOSPlatform=\"" << info.GetOSPlatform() << "\"\n"
<< "\tIs64Bits=\"" << info.Is64Bits() << "\"\n"
<< "\tVendorString=\"" << info.GetVendorString() << "\"\n"
<< "\tVendorID=\"" << info.GetVendorID() << "\"\n"
<< "\tFamilyID=\"" << info.GetFamilyID() << "\"\n"
<< "\tModelID=\"" << info.GetModelID() << "\"\n"
<< "\tProcessorCacheSize=\"" << info.GetProcessorCacheSize() << "\"\n"
<< "\tNumberOfLogicalCPU=\"" << info.GetNumberOfLogicalCPU() << "\"\n"
<< "\tNumberOfPhysicalCPU=\""<< info.GetNumberOfPhysicalCPU() << "\"\n"
<< "\tTotalVirtualMemory=\"" << info.GetTotalVirtualMemory() << "\"\n"
<< "\tTotalPhysicalMemory=\""<< info.GetTotalPhysicalMemory() << "\"\n"
<< "\tLogicalProcessorsPerPhysical=\""
<< info.GetLogicalProcessorsPerPhysical() << "\"\n"
<< "\tProcessorClockFrequency=\""
<< info.GetProcessorClockFrequency() << "\"\n"
<< ">" << std::endl;
this->AddSiteProperties(ostr);
}
//----------------------------------------------------------------------
void cmCTest::AddSiteProperties(std::ostream& ostr)
{
cmCTestScriptHandler* ch =
static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
cmake* cm = ch->GetCMake();
// if no CMake then this is the old style script and props like
// this will not work anyway.
if(!cm)
{
return;
}
// This code should go when cdash is changed to use labels only
const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL);
if(subproject)
{
ostr << "<Subproject name=\"" << subproject << "\">\n";
const char* labels =
ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL);
if(labels)
{
ostr << " <Labels>\n";
std::string l = labels;
std::vector<std::string> args;
cmSystemTools::ExpandListArgument(l, args);
for(std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i)
{
ostr << " <Label>" << i->c_str() << "</Label>\n";
}
ostr << " </Labels>\n";
}
ostr << "</Subproject>\n";
}
// This code should stay when cdash only does label based sub-projects
const char* label = cm->GetProperty("Label", cmProperty::GLOBAL);
if(label)
{
ostr << "<Labels>\n";
ostr << " <Label>" << label << "</Label>\n";
ostr << "</Labels>\n";
}
}
//----------------------------------------------------------------------
void cmCTest::EndXML(std::ostream& ostr)
{
ostr << "</Site>" << std::endl;
}
//----------------------------------------------------------------------
int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
const cmCTest::VectorOfStrings& files)
{
cmCTest::VectorOfStrings::const_iterator it;
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
<< "<?xml-stylesheet type=\"text/xsl\" "
"href=\"Dart/Source/Server/XSL/Build.xsl "
"<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
<< "<Site BuildName=\"" << this->GetCTestConfiguration("BuildName")
<< "\" BuildStamp=\""
<< this->CurrentTag << "-" << this->GetTestModelString() << "\" Name=\""
<< this->GetCTestConfiguration("Site") << "\" Generator=\"ctest"
<< cmVersion::GetCMakeVersion()
<< "\">\n";
this->AddSiteProperties(os);
os << "<Notes>" << std::endl;
for ( it = files.begin(); it != files.end(); it ++ )
{
cmCTestLog(this, OUTPUT, "\tAdd file: " << it->c_str() << std::endl);
std::string note_time = this->CurrentTime();
os << "<Note Name=\"" << cmXMLSafe(*it) << "\">\n"
<< "<Time>" << cmSystemTools::GetTime() << "</Time>\n"
<< "<DateTime>" << note_time << "</DateTime>\n"
<< "<Text>" << std::endl;
std::ifstream ifs(it->c_str());
if ( ifs )
{
std::string line;
while ( cmSystemTools::GetLineFromStream(ifs, line) )
{
os << cmXMLSafe(line) << std::endl;
}
ifs.close();
}
else
{
os << "Problem reading file: " << it->c_str() << std::endl;
cmCTestLog(this, ERROR_MESSAGE, "Problem reading file: " << it->c_str()
<< " while creating notes" << std::endl);
}
os << "</Text>\n"
<< "</Note>" << std::endl;
}
os << "</Notes>\n"
<< "</Site>" << std::endl;
return 1;
}
//----------------------------------------------------------------------
int cmCTest::GenerateNotesFile(const std::vector<cmStdString> &files)
{
cmGeneratedFileStream ofs;
if ( !this->OpenOutputFile(this->CurrentTag, "Notes.xml", ofs) )
{
cmCTestLog(this, ERROR_MESSAGE, "Cannot open notes file" << std::endl);
return 1;
}
this->GenerateCTestNotesOutput(ofs, files);
return 0;
}
//----------------------------------------------------------------------
int cmCTest::GenerateNotesFile(const char* cfiles)
{
if ( !cfiles )
{
return 1;
}
std::vector<cmStdString> files;
cmCTestLog(this, OUTPUT, "Create notes file" << std::endl);
files = cmSystemTools::SplitString(cfiles, ';');
if ( files.size() == 0 )
{
return 1;
}
return this->GenerateNotesFile(files);
}
//----------------------------------------------------------------------
bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
{
std::vector<cmStdString>::const_iterator it;
for ( it = files.begin();
it != files.end();
++ it )
{
if ( !cmSystemTools::FileExists(it->c_str()) )
{
cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: "
<< it->c_str() << " to submit."
<< std::endl;);
return false;
}
this->AddSubmitFile(PartExtraFiles, it->c_str());
}
return true;
}
//----------------------------------------------------------------------
bool cmCTest::SubmitExtraFiles(const char* cfiles)
{
if ( !cfiles )
{
return 1;
}
std::vector<cmStdString> files;
cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
files = cmSystemTools::SplitString(cfiles, ';');
if ( files.size() == 0 )
{
return 1;
}
return this->SubmitExtraFiles(files);
}
//-------------------------------------------------------
// for a -D argument convert the next argument into
// the proper list of dashboard steps via SetTest
bool cmCTest::AddTestsForDashboardType(std::string &targ)
{
if ( targ == "Experimental" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Start");
this->SetTest("Configure");
this->SetTest("Build");
this->SetTest("Test");
this->SetTest("Coverage");
this->SetTest("Submit");
}
else if ( targ == "ExperimentalStart" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Start");
}
else if ( targ == "ExperimentalUpdate" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Update");
}
else if ( targ == "ExperimentalConfigure" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Configure");
}
else if ( targ == "ExperimentalBuild" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Build");
}
else if ( targ == "ExperimentalTest" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Test");
}
else if ( targ == "ExperimentalMemCheck"
|| targ == "ExperimentalPurify" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("MemCheck");
}
else if ( targ == "ExperimentalCoverage" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Coverage");
}
else if ( targ == "ExperimentalSubmit" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Submit");
}
else if ( targ == "Continuous" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Start");
this->SetTest("Update");
this->SetTest("Configure");
this->SetTest("Build");
this->SetTest("Test");
this->SetTest("Coverage");
this->SetTest("Submit");
}
else if ( targ == "ContinuousStart" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Start");
}
else if ( targ == "ContinuousUpdate" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Update");
}
else if ( targ == "ContinuousConfigure" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Configure");
}
else if ( targ == "ContinuousBuild" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Build");
}
else if ( targ == "ContinuousTest" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Test");
}
else if ( targ == "ContinuousMemCheck"
|| targ == "ContinuousPurify" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("MemCheck");
}
else if ( targ == "ContinuousCoverage" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Coverage");
}
else if ( targ == "ContinuousSubmit" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
this->SetTest("Submit");
}
else if ( targ == "Nightly" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Start");
this->SetTest("Update");
this->SetTest("Configure");
this->SetTest("Build");
this->SetTest("Test");
this->SetTest("Coverage");
this->SetTest("Submit");
}
else if ( targ == "NightlyStart" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Start");
}
else if ( targ == "NightlyUpdate" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Update");
}
else if ( targ == "NightlyConfigure" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Configure");
}
else if ( targ == "NightlyBuild" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Build");
}
else if ( targ == "NightlyTest" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Test");
}
else if ( targ == "NightlyMemCheck"
|| targ == "NightlyPurify" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("MemCheck");
}
else if ( targ == "NightlyCoverage" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Coverage");
}
else if ( targ == "NightlySubmit" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Submit");
}
else if ( targ == "MemoryCheck" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
this->SetTest("Start");
this->SetTest("Configure");
this->SetTest("Build");
this->SetTest("MemCheck");
this->SetTest("Coverage");
this->SetTest("Submit");
}
else if ( targ == "NightlyMemoryCheck" )
{
this->SetTestModel(cmCTest::NIGHTLY);
this->SetTest("Start");
this->SetTest("Update");
this->SetTest("Configure");
this->SetTest("Build");
this->SetTest("MemCheck");
this->SetTest("Coverage");
this->SetTest("Submit");
}
else
{
cmCTestLog(this, ERROR_MESSAGE,
"CTest -D called with incorrect option: "
<< targ << std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << "ctest" << " -D Continuous" << std::endl
<< " " << "ctest"
<< " -D Continuous(Start|Update|Configure|Build)" << std::endl
<< " " << "ctest"
<< " -D Continuous(Test|Coverage|MemCheck|Submit)"
<< std::endl
<< " " << "ctest" << " -D Experimental" << std::endl
<< " " << "ctest"
<< " -D Experimental(Start|Update|Configure|Build)"
<< std::endl
<< " " << "ctest"
<< " -D Experimental(Test|Coverage|MemCheck|Submit)"
<< std::endl
<< " " << "ctest" << " -D Nightly" << std::endl
<< " " << "ctest"
<< " -D Nightly(Start|Update|Configure|Build)" << std::endl
<< " " << "ctest"
<< " -D Nightly(Test|Coverage|MemCheck|Submit)" << std::endl
<< " " << "ctest" << " -D NightlyMemoryCheck" << std::endl);
return false;
}
return true;
}
//----------------------------------------------------------------------
bool cmCTest::CheckArgument(const std::string& arg, const char* varg1,
const char* varg2)
{
return (varg1 && arg == varg1) || (varg2 && arg == varg2);
}
//----------------------------------------------------------------------
// Processes one command line argument (and its arguments if any)
// for many simple options and then returns
void cmCTest::HandleCommandLineArguments(size_t &i,
std::vector<std::string> &args)
{
std::string arg = args[i];
if(this->CheckArgument(arg, "-F"))
{
this->Failover = true;
}
if(this->CheckArgument(arg, "-j", "--parallel") && i < args.size() - 1)
{
i++;
int plevel = atoi(args[i].c_str());
this->SetParallelLevel(plevel);
}
else if(arg.find("-j") == 0)
{
int plevel = atoi(arg.substr(2).c_str());
this->SetParallelLevel(plevel);
}
if(this->CheckArgument(arg, "-C", "--build-config") &&
i < args.size() - 1)
{
i++;
this->SetConfigType(args[i].c_str());
}
if(this->CheckArgument(arg, "--debug"))
{
this->Debug = true;
this->ShowLineNumbers = true;
}
if(this->CheckArgument(arg, "--track") && i < args.size() - 1)
{
i++;
this->SpecificTrack = args[i];
}
if(this->CheckArgument(arg, "--show-line-numbers"))
{
this->ShowLineNumbers = true;
}
if(this->CheckArgument(arg, "--no-label-summary"))
{
this->LabelSummary = false;
}
if(this->CheckArgument(arg, "-Q", "--quiet"))
{
this->Quiet = true;
}
if(this->CheckArgument(arg, "-V", "--verbose"))
{
this->Verbose = true;
}
if(this->CheckArgument(arg, "-B"))
{
this->BatchJobs = true;
}
if(this->CheckArgument(arg, "-VV", "--extra-verbose"))
{
this->ExtraVerbose = true;
this->Verbose = true;
}
if(this->CheckArgument(arg, "--output-on-failure"))
{
this->OutputTestOutputOnTestFailure = true;
}
if(this->CheckArgument(arg, "-N", "--show-only"))
{
this->ShowOnly = true;
}
if(this->CheckArgument(arg, "-O", "--output-log") && i < args.size() - 1 )
{
i++;
this->SetOutputLogFileName(args[i].c_str());
}
if(this->CheckArgument(arg, "--tomorrow-tag"))
{
this->TomorrowTag = true;
}
if(this->CheckArgument(arg, "--force-new-ctest-process"))
{
this->ForceNewCTestProcess = true;
}
if(this->CheckArgument(arg, "-W", "--max-width") && i < args.size() - 1)
{
i++;
this->MaxTestNameWidth = atoi(args[i].c_str());
}
if(this->CheckArgument(arg, "--interactive-debug-mode") &&
i < args.size() - 1 )
{
i++;
this->InteractiveDebugMode = cmSystemTools::IsOn(args[i].c_str());
}
if(this->CheckArgument(arg, "--submit-index") && i < args.size() - 1 )
{
i++;
this->SubmitIndex = atoi(args[i].c_str());
if ( this->SubmitIndex < 0 )
{
this->SubmitIndex = 0;
}
}
if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
{
i++;
this->AddCTestConfigurationOverwrite(args[i].c_str());
}
if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1)
{
this->ProduceXML = true;
this->SetTest("Notes");
i++;
this->SetNotesFiles(args[i].c_str());
}
// options that control what tests are run
if(this->CheckArgument(arg, "-I", "--tests-information") &&
i < args.size() - 1)
{
i++;
this->GetHandler("test")->SetPersistentOption("TestsToRunInformation",
args[i].c_str());
this->GetHandler("memcheck")->
SetPersistentOption("TestsToRunInformation",args[i].c_str());
}
if(this->CheckArgument(arg, "-U", "--union"))
{
this->GetHandler("test")->SetPersistentOption("UseUnion", "true");
this->GetHandler("memcheck")->SetPersistentOption("UseUnion", "true");
}
if(this->CheckArgument(arg, "-R", "--tests-regex") && i < args.size() - 1)
{
i++;
this->GetHandler("test")->
SetPersistentOption("IncludeRegularExpression", args[i].c_str());
this->GetHandler("memcheck")->
SetPersistentOption("IncludeRegularExpression", args[i].c_str());
}
if(this->CheckArgument(arg, "-L", "--label-regex") && i < args.size() - 1)
{
i++;
this->GetHandler("test")->
SetPersistentOption("LabelRegularExpression", args[i].c_str());
this->GetHandler("memcheck")->
SetPersistentOption("LabelRegularExpression", args[i].c_str());
}
if(this->CheckArgument(arg, "-LE", "--label-exclude") && i < args.size() - 1)
{
i++;
this->GetHandler("test")->
SetPersistentOption("ExcludeLabelRegularExpression", args[i].c_str());
this->GetHandler("memcheck")->
SetPersistentOption("ExcludeLabelRegularExpression", args[i].c_str());
}
if(this->CheckArgument(arg, "-E", "--exclude-regex") &&
i < args.size() - 1)
{
i++;
this->GetHandler("test")->
SetPersistentOption("ExcludeRegularExpression", args[i].c_str());
this->GetHandler("memcheck")->
SetPersistentOption("ExcludeRegularExpression", args[i].c_str());
}
}
//----------------------------------------------------------------------
// handle the -S -SR and -SP arguments
void cmCTest::HandleScriptArguments(size_t &i,
std::vector<std::string> &args,
bool &SRArgumentSpecified)
{
std::string arg = args[i];
if(this->CheckArgument(arg, "-SP", "--script-new-process") &&
i < args.size() - 1 )
{
this->RunConfigurationScript = true;
i++;
cmCTestScriptHandler* ch
= static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
// -SR is an internal argument, -SP should be ignored when it is passed
if (!SRArgumentSpecified)
{
ch->AddConfigurationScript(args[i].c_str(),false);
}
}
if(this->CheckArgument(arg, "-SR", "--script-run") &&
i < args.size() - 1 )
{
SRArgumentSpecified = true;
this->RunConfigurationScript = true;
i++;
cmCTestScriptHandler* ch
= static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
ch->AddConfigurationScript(args[i].c_str(),true);
}
if(this->CheckArgument(arg, "-S", "--script") && i < args.size() - 1 )
{
this->RunConfigurationScript = true;
i++;
cmCTestScriptHandler* ch
= static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
// -SR is an internal argument, -S should be ignored when it is passed
if (!SRArgumentSpecified)
{
ch->AddConfigurationScript(args[i].c_str(),true);
}
}
}
//----------------------------------------------------------------------
// the main entry point of ctest, called from main
int cmCTest::Run(std::vector<std::string> &args, std::string* output)
{
this->FindRunningCMake();
const char* ctestExec = "ctest";
bool cmakeAndTest = false;
bool performSomeTest = true;
bool SRArgumentSpecified = false;
// copy the command line
for(size_t i=0; i < args.size(); ++i)
{
this->InitialCommandLineArguments.push_back(args[i]);
}
// process the command line arguments
for(size_t i=1; i < args.size(); ++i)
{
// handle the simple commandline arguments
this->HandleCommandLineArguments(i,args);
// handle the script arguments -S -SR -SP
this->HandleScriptArguments(i,args,SRArgumentSpecified);
// handle a request for a dashboard
std::string arg = args[i];
if(this->CheckArgument(arg, "-D", "--dashboard") && i < args.size() - 1 )
{
this->ProduceXML = true;
i++;
std::string targ = args[i];
// AddTestsForDashboard parses the dashborad type and converts it
// into the seperate stages
if (!this->AddTestsForDashboardType(targ))
{
performSomeTest = false;
}
}
if(this->CheckArgument(arg, "-T", "--test-action") &&
(i < args.size() -1) )
{
this->ProduceXML = true;
i++;
if ( !this->SetTest(args[i].c_str(), false) )
{
performSomeTest = false;
cmCTestLog(this, ERROR_MESSAGE,
"CTest -T called with incorrect option: "
<< args[i].c_str() << std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << ctestExec << " -T all" << std::endl
<< " " << ctestExec << " -T start" << std::endl
<< " " << ctestExec << " -T update" << std::endl
<< " " << ctestExec << " -T configure" << std::endl
<< " " << ctestExec << " -T build" << std::endl
<< " " << ctestExec << " -T test" << std::endl
<< " " << ctestExec << " -T coverage" << std::endl
<< " " << ctestExec << " -T memcheck" << std::endl
<< " " << ctestExec << " -T notes" << std::endl
<< " " << ctestExec << " -T submit" << std::endl);
}
}
// what type of test model
if(this->CheckArgument(arg, "-M", "--test-model") &&
(i < args.size() -1) )
{
i++;
std::string const& str = args[i];
if ( cmSystemTools::LowerCase(str) == "nightly" )
{
this->SetTestModel(cmCTest::NIGHTLY);
}
else if ( cmSystemTools::LowerCase(str) == "continuous" )
{
this->SetTestModel(cmCTest::CONTINUOUS);
}
else if ( cmSystemTools::LowerCase(str) == "experimental" )
{
this->SetTestModel(cmCTest::EXPERIMENTAL);
}
else
{
performSomeTest = false;
cmCTestLog(this, ERROR_MESSAGE,
"CTest -M called with incorrect option: " << str.c_str()
<< std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << ctestExec << " -M Continuous" << std::endl
<< " " << ctestExec << " -M Experimental" << std::endl
<< " " << ctestExec << " -M Nightly" << std::endl);
}
}
if(this->CheckArgument(arg, "--extra-submit") && i < args.size() - 1)
{
this->ProduceXML = true;
this->SetTest("Submit");
i++;
if ( !this->SubmitExtraFiles(args[i].c_str()) )
{
return 0;
}
}
// --build-and-test options
if(this->CheckArgument(arg, "--build-and-test") && i < args.size() - 1)
{
cmakeAndTest = true;
}
// pass the argument to all the handlers as well, but i may no longer be
// set to what it was originally so I'm not sure this is working as
// intended
cmCTest::t_TestingHandlers::iterator it;
for ( it = this->TestingHandlers.begin();
it != this->TestingHandlers.end();
++ it )
{
if ( !it->second->ProcessCommandLineArguments(arg, i, args) )
{
cmCTestLog(this, ERROR_MESSAGE,
"Problem parsing command line arguments within a handler");
return 0;
}
}
} // the close of the for argument loop
// now what sould cmake do? if --build-and-test was specified then
// we run the build and test handler and return
if(cmakeAndTest)
{
this->Verbose = true;
cmCTestBuildAndTestHandler* handler =
static_cast<cmCTestBuildAndTestHandler*>(this->GetHandler("buildtest"));
int retv = handler->ProcessHandler();
*output = handler->GetOutput();
#ifdef CMAKE_BUILD_WITH_CMAKE
cmDynamicLoader::FlushCache();
#endif
if(retv != 0)
{
cmCTestLog(this, DEBUG, "build and test failing returing: " << retv
<< std::endl);
}
return retv;
}
// if some tests must be run
if(performSomeTest)
{
int res;
// call process directory
if (this->RunConfigurationScript)
{
if ( this->ExtraVerbose )
{
cmCTestLog(this, OUTPUT, "* Extra verbosity turned on" << std::endl);
}
cmCTest::t_TestingHandlers::iterator it;
for ( it = this->TestingHandlers.begin();
it != this->TestingHandlers.end();
++ it )
{
it->second->SetVerbose(this->ExtraVerbose);
it->second->SetSubmitIndex(this->SubmitIndex);
}
this->GetHandler("script")->SetVerbose(this->Verbose);
res = this->GetHandler("script")->ProcessHandler();
if(res != 0)
{
cmCTestLog(this, DEBUG, "running script failing returning: " << res
<< std::endl);
}
}
else
{
// What is this? -V seems to be the same as -VV,
// and Verbose is always on in this case
this->ExtraVerbose = this->Verbose;
this->Verbose = true;
cmCTest::t_TestingHandlers::iterator it;
for ( it = this->TestingHandlers.begin();
it != this->TestingHandlers.end();
++ it )
{
it->second->SetVerbose(this->Verbose);
it->second->SetSubmitIndex(this->SubmitIndex);
}
if ( !this->Initialize(
cmSystemTools::GetCurrentWorkingDirectory().c_str()) )
{
res = 12;
cmCTestLog(this, ERROR_MESSAGE, "Problem initializing the dashboard."
<< std::endl);
}
else
{
res = this->ProcessTests();
}
this->Finalize();
}
if(res != 0)
{
cmCTestLog(this, DEBUG, "Running a test(s) failed returning : " << res
<< std::endl);
}
return res;
}
return 1;
}
//----------------------------------------------------------------------
void cmCTest::FindRunningCMake()
{
// Find our own executable.
this->CTestSelf = cmSystemTools::GetExecutableDirectory();
this->CTestSelf += "/ctest";
this->CTestSelf += cmSystemTools::GetExecutableExtension();
if(!cmSystemTools::FileExists(this->CTestSelf.c_str()))
{
cmSystemTools::Error("CTest executable cannot be found at ",
this->CTestSelf.c_str());
}
this->CMakeSelf = cmSystemTools::GetExecutableDirectory();
this->CMakeSelf += "/cmake";
this->CMakeSelf += cmSystemTools::GetExecutableExtension();
if(!cmSystemTools::FileExists(this->CMakeSelf.c_str()))
{
cmSystemTools::Error("CMake executable cannot be found at ",
this->CMakeSelf.c_str());
}
}
//----------------------------------------------------------------------
void cmCTest::SetNotesFiles(const char* notes)
{
if ( !notes )
{
return;
}
this->NotesFiles = notes;
}
//----------------------------------------------------------------------
int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
{
bool found = false;
VectorOfStrings dirs;
VectorOfStrings ndirs;
cmCTestLog(this, DEBUG, "* Read custom CTest configuration directory: "
<< dir << std::endl);
std::string fname = dir;
fname += "/CTestCustom.cmake";
cmCTestLog(this, DEBUG, "* Check for file: "
<< fname.c_str() << std::endl);
if ( cmSystemTools::FileExists(fname.c_str()) )
{
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
<< fname.c_str() << std::endl);
bool erroroc = cmSystemTools::GetErrorOccuredFlag();
cmSystemTools::ResetErrorOccuredFlag();
if ( !mf->ReadListFile(0, fname.c_str()) ||
cmSystemTools::GetErrorOccuredFlag() )
{
cmCTestLog(this, ERROR_MESSAGE,
"Problem reading custom configuration: "
<< fname.c_str() << std::endl);
}
found = true;
if ( erroroc )
{
cmSystemTools::SetErrorOccured();
}
}
std::string rexpr = dir;
rexpr += "/CTestCustom.ctest";
cmCTestLog(this, DEBUG, "* Check for file: "
<< rexpr.c_str() << std::endl);
if ( !found && cmSystemTools::FileExists(rexpr.c_str()) )
{
cmsys::Glob gl;
gl.RecurseOn();
gl.FindFiles(rexpr);
std::vector<std::string>& files = gl.GetFiles();
std::vector<std::string>::iterator fileIt;
for ( fileIt = files.begin(); fileIt != files.end();
++ fileIt )
{
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
<< fileIt->c_str() << std::endl);
if ( !mf->ReadListFile(0, fileIt->c_str()) ||
cmSystemTools::GetErrorOccuredFlag() )
{
cmCTestLog(this, ERROR_MESSAGE,
"Problem reading custom configuration: "
<< fileIt->c_str() << std::endl);
}
}
found = true;
}
if ( found )
{
cmCTest::t_TestingHandlers::iterator it;
for ( it = this->TestingHandlers.begin();
it != this->TestingHandlers.end(); ++ it )
{
cmCTestLog(this, DEBUG,
"* Read custom CTest configuration vectors for handler: "
<< it->first.c_str() << " (" << it->second << ")" << std::endl);
it->second->PopulateCustomVectors(mf);
}
}
return 1;
}
//----------------------------------------------------------------------
void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
VectorOfStrings& vec)
{
if ( !def)
{
return;
}
const char* dval = mf->GetDefinition(def);
if ( !dval )
{
return;
}
cmCTestLog(this, DEBUG, "PopulateCustomVector: " << def << std::endl);
std::vector<std::string> slist;
cmSystemTools::ExpandListArgument(dval, slist);
std::vector<std::string>::iterator it;
for ( it = slist.begin(); it != slist.end(); ++it )
{
cmCTestLog(this, DEBUG, " -- " << it->c_str() << std::endl);
vec.push_back(it->c_str());
}
}
//----------------------------------------------------------------------
void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val)
{
if ( !def)
{
return;
}
const char* dval = mf->GetDefinition(def);
if ( !dval )
{
return;
}
val = atoi(dval);
}
//----------------------------------------------------------------------
std::string cmCTest::GetShortPathToFile(const char* cfname)
{
const std::string& sourceDir
= cmSystemTools::CollapseFullPath(
this->GetCTestConfiguration("SourceDirectory").c_str());
const std::string& buildDir
= cmSystemTools::CollapseFullPath(
this->GetCTestConfiguration("BuildDirectory").c_str());
std::string fname = cmSystemTools::CollapseFullPath(cfname);
// Find relative paths to both directories
std::string srcRelpath
= cmSystemTools::RelativePath(sourceDir.c_str(), fname.c_str());
std::string bldRelpath
= cmSystemTools::RelativePath(buildDir.c_str(), fname.c_str());
// If any contains "." it is not parent directory
bool inSrc = srcRelpath.find("..") == srcRelpath.npos;
bool inBld = bldRelpath.find("..") == bldRelpath.npos;
// TODO: Handle files with .. in their name
std::string* res = 0;
if ( inSrc && inBld )
{
// If both have relative path with no dots, pick the shorter one
if ( srcRelpath.size() < bldRelpath.size() )
{
res = &srcRelpath;
}
else
{
res = &bldRelpath;
}
}
else if ( inSrc )
{
res = &srcRelpath;
}
else if ( inBld )
{
res = &bldRelpath;
}
std::string path;
if ( !res )
{
path = fname;
}
else
{
cmSystemTools::ConvertToUnixSlashes(*res);
path = "./" + *res;
if ( path[path.size()-1] == '/' )
{
path = path.substr(0, path.size()-1);
}
}
cmsys::SystemTools::ReplaceString(path, ":", "_");
cmsys::SystemTools::ReplaceString(path, " ", "_");
return path;
}
//----------------------------------------------------------------------
std::string cmCTest::GetCTestConfiguration(const char *name)
{
if ( this->CTestConfigurationOverwrites.find(name) !=
this->CTestConfigurationOverwrites.end() )
{
return this->CTestConfigurationOverwrites[name];
}
return this->CTestConfiguration[name];
}
//----------------------------------------------------------------------
void cmCTest::EmptyCTestConfiguration()
{
this->CTestConfiguration.clear();
}
//----------------------------------------------------------------------
void cmCTest::SetCTestConfiguration(const char *name, const char* value)
{
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "SetCTestConfiguration:"
<< name << ":" << (value ? value : "(null)") << "\n");
if ( !name )
{
return;
}
if ( !value )
{
this->CTestConfiguration.erase(name);
return;
}
this->CTestConfiguration[name] = value;
}
//----------------------------------------------------------------------
std::string cmCTest::GetCurrentTag()
{
return this->CurrentTag;
}
//----------------------------------------------------------------------
std::string cmCTest::GetBinaryDir()
{
return this->BinaryDir;
}
//----------------------------------------------------------------------
std::string const& cmCTest::GetConfigType()
{
return this->ConfigType;
}
//----------------------------------------------------------------------
bool cmCTest::GetShowOnly()
{
return this->ShowOnly;
}
//----------------------------------------------------------------------
int cmCTest::GetMaxTestNameWidth() const
{
return this->MaxTestNameWidth;
}
//----------------------------------------------------------------------
void cmCTest::SetProduceXML(bool v)
{
this->ProduceXML = v;
}
//----------------------------------------------------------------------
bool cmCTest::GetProduceXML()
{
return this->ProduceXML;
}
//----------------------------------------------------------------------
const char* cmCTest::GetSpecificTrack()
{
if ( this->SpecificTrack.empty() )
{
return 0;
}
return this->SpecificTrack.c_str();
}
//----------------------------------------------------------------------
void cmCTest::SetSpecificTrack(const char* track)
{
if ( !track )
{
this->SpecificTrack = "";
return;
}
this->SpecificTrack = track;
}
//----------------------------------------------------------------------
void cmCTest::AddSubmitFile(Part part, const char* name)
{
this->Parts[part].SubmitFiles.push_back(name);
}
//----------------------------------------------------------------------
void cmCTest::AddCTestConfigurationOverwrite(const char* encstr)
{
std::string overStr = encstr;
size_t epos = overStr.find("=");
if ( epos == overStr.npos )
{
cmCTestLog(this, ERROR_MESSAGE,
"CTest configuration overwrite specified in the wrong format."
<< std::endl
<< "Valid format is: --overwrite key=value" << std::endl
<< "The specified was: --overwrite " << overStr.c_str() << std::endl);
return;
}
std::string key = overStr.substr(0, epos);
std::string value = overStr.substr(epos+1, overStr.npos);
this->CTestConfigurationOverwrites[key] = value;
}
//----------------------------------------------------------------------
void cmCTest::SetConfigType(const char* ct)
{
this->ConfigType = ct?ct:"";
cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
std::string confTypeEnv
= "CMAKE_CONFIG_TYPE=" + this->ConfigType;
cmSystemTools::PutEnv(confTypeEnv.c_str());
}
//----------------------------------------------------------------------
bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
const char* dconfig, const char* cmake_var)
{
const char* ctvar;
ctvar = mf->GetDefinition(cmake_var);
if ( !ctvar )
{
return false;
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"SetCTestConfigurationFromCMakeVariable:"
<< dconfig << ":" << cmake_var);
this->SetCTestConfiguration(dconfig, ctvar);
return true;
}
bool cmCTest::RunCommand(
const char* command,
std::string* stdOut,
std::string* stdErr,
int *retVal,
const char* dir,
double timeout)
{
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
if(args.size() < 1)
{
return false;
}
std::vector<const char*> argv;
for(std::vector<cmStdString>::const_iterator a = args.begin();
a != args.end(); ++a)
{
argv.push_back(a->c_str());
}
argv.push_back(0);
*stdOut = "";
*stdErr = "";
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetCommand(cp, &*argv.begin());
cmsysProcess_SetWorkingDirectory(cp, dir);
if(cmSystemTools::GetRunCommandHideConsole())
{
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
}
cmsysProcess_SetTimeout(cp, timeout);
cmsysProcess_Execute(cp);
std::vector<char> tempOutput;
std::vector<char> tempError;
char* data;
int length;
int res;
bool done = false;
while(!done)
{
res = cmsysProcess_WaitForData(cp, &data, &length, 0);
switch ( res )
{
case cmsysProcess_Pipe_STDOUT:
tempOutput.insert(tempOutput.end(), data, data+length);
break;
case cmsysProcess_Pipe_STDERR:
tempError.insert(tempError.end(), data, data+length);
break;
default:
done = true;
}
if ( (res == cmsysProcess_Pipe_STDOUT ||
res == cmsysProcess_Pipe_STDERR) && this->ExtraVerbose )
{
cmSystemTools::Stdout(data, length);
}
}
cmsysProcess_WaitForExit(cp, 0);
if ( tempOutput.size() > 0 )
{
stdOut->append(&*tempOutput.begin(), tempOutput.size());
}
if ( tempError.size() > 0 )
{
stdErr->append(&*tempError.begin(), tempError.size());
}
bool result = true;
if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited)
{
if ( retVal )
{
*retVal = cmsysProcess_GetExitValue(cp);
}
else
{
if ( cmsysProcess_GetExitValue(cp) != 0 )
{
result = false;
}
}
}
else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exception)
{
const char* exception_str = cmsysProcess_GetExceptionString(cp);
cmCTestLog(this, ERROR_MESSAGE, exception_str << std::endl);
stdErr->append(exception_str, strlen(exception_str));
result = false;
}
else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Error)
{
const char* error_str = cmsysProcess_GetErrorString(cp);
cmCTestLog(this, ERROR_MESSAGE, error_str << std::endl);
stdErr->append(error_str, strlen(error_str));
result = false;
}
else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Expired)
{
const char* error_str = "Process terminated due to timeout\n";
cmCTestLog(this, ERROR_MESSAGE, error_str << std::endl);
stdErr->append(error_str, strlen(error_str));
result = false;
}
cmsysProcess_Delete(cp);
return result;
}
//----------------------------------------------------------------------
void cmCTest::SetOutputLogFileName(const char* name)
{
if ( this->OutputLogFile)
{
delete this->OutputLogFile;
this->OutputLogFile= 0;
}
if ( name )
{
this->OutputLogFile = new cmGeneratedFileStream(name);
}
}
//----------------------------------------------------------------------
static const char* cmCTestStringLogType[] =
{
"DEBUG",
"OUTPUT",
"HANDLER_OUTPUT",
"HANDLER_VERBOSE_OUTPUT",
"WARNING",
"ERROR_MESSAGE",
0
};
//----------------------------------------------------------------------
#ifdef cerr
# undef cerr
#endif
#ifdef cout
# undef cout
#endif
#define cmCTestLogOutputFileLine(stream) \
if ( this->ShowLineNumbers ) \
{ \
(stream) << std::endl << file << ":" << line << " "; \
}
void cmCTest::InitStreams()
{
// By default we write output to the process output streams.
this->StreamOut = &std::cout;
this->StreamErr = &std::cerr;
}
void cmCTest::Log(int logType, const char* file, int line, const char* msg)
{
if ( !msg || !*msg )
{
return;
}
if ( this->OutputLogFile )
{
bool display = true;
if ( logType == cmCTest::DEBUG && !this->Debug ) { display = false; }
if ( logType == cmCTest::HANDLER_VERBOSE_OUTPUT && !this->Debug &&
!this->ExtraVerbose ) { display = false; }
if ( display )
{
cmCTestLogOutputFileLine(*this->OutputLogFile);
if ( logType != this->OutputLogFileLastTag )
{
*this->OutputLogFile << "[";
if ( logType >= OTHER || logType < 0 )
{
*this->OutputLogFile << "OTHER";
}
else
{
*this->OutputLogFile << cmCTestStringLogType[logType];
}
*this->OutputLogFile << "] " << std::endl << std::flush;
}
*this->OutputLogFile << msg << std::flush;
if ( logType != this->OutputLogFileLastTag )
{
*this->OutputLogFile << std::endl << std::flush;
this->OutputLogFileLastTag = logType;
}
}
}
if ( !this->Quiet )
{
std::ostream& out = *this->StreamOut;
std::ostream& err = *this->StreamErr;
switch ( logType )
{
case DEBUG:
if ( this->Debug )
{
cmCTestLogOutputFileLine(out);
out << msg;
out.flush();
}
break;
case OUTPUT: case HANDLER_OUTPUT:
if ( this->Debug || this->Verbose )
{
cmCTestLogOutputFileLine(out);
out << msg;
out.flush();
}
break;
case HANDLER_VERBOSE_OUTPUT:
if ( this->Debug || this->ExtraVerbose )
{
cmCTestLogOutputFileLine(out);
out << msg;
out.flush();
}
break;
case WARNING:
cmCTestLogOutputFileLine(err);
err << msg;
err.flush();
break;
case ERROR_MESSAGE:
cmCTestLogOutputFileLine(err);
err << msg;
err.flush();
cmSystemTools::SetErrorOccured();
break;
default:
cmCTestLogOutputFileLine(out);
out << msg;
out.flush();
}
}
}
//-------------------------------------------------------------------------
double cmCTest::GetRemainingTimeAllowed()
{
if (!this->GetHandler("script"))
{
return 1.0e7;
}
cmCTestScriptHandler* ch
= static_cast<cmCTestScriptHandler*>(this->GetHandler("script"));
return ch->GetRemainingTimeAllowed();
}
//----------------------------------------------------------------------
void cmCTest::OutputTestErrors(std::vector<char> const &process_output)
{
std::string test_outputs("\n*** Test Failed:\n");
if(process_output.size())
{
test_outputs.append(&*process_output.begin(), process_output.size());
}
cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl << std::flush);
}
| [
"bassoncheng@gmail.com"
] | bassoncheng@gmail.com |
4086b5ee2e40c44c37c576f7ad996e79f47f5f32 | 6f3ededa42c35f313a7d34c591d732b2602a9a5e | /ouzel/gui/ScrollBar.hpp | 1c2065594a7579a3bd6a3698e7ee44caa8faefc0 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | WooZoo86/ouzel | ebd0f2a13aa76e447c80ed03eda797bf6e625e83 | 7c950c4dc7c73d5f2e8ccce69fee9c876b9ac5ba | refs/heads/master | 2021-05-14T07:41:52.977341 | 2017-12-23T04:05:48 | 2017-12-23T04:05:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 310 | hpp | // Copyright (C) 2017 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include "gui/Widget.hpp"
namespace ouzel
{
namespace gui
{
class ScrollBar: public Widget
{
public:
ScrollBar();
};
} // namespace gui
} // namespace ouzel
| [
"elviss@elviss.lv"
] | elviss@elviss.lv |
e6c51f67253d95425d3407c96c914881776d9446 | d1ba96c3af2f5a73a0f4371bddd64ea72bbc0887 | /modeleditorwidget.cpp | 50ba3394c2c60d7d98bf7369ec50240781cd90a7 | [] | no_license | zzambia/License-plate-generator | c2ee6f2a3caa30b90d8688c3b5f9aaac749d896d | 9813c4e1db12b458fe5b7bce9728040f3146c5e8 | refs/heads/master | 2023-03-17T11:48:47.358633 | 2019-12-04T19:00:30 | 2019-12-04T19:00:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,865 | cpp | #include "modeleditorwidget.h"
#include "managers.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
RenderStep::RenderStep(Qt3DRender::QMaterial *material, RenderStep *next)
: nextStep(next)
, mat(material)
{
}
FirstRenderStep::FirstRenderStep(Qt3DRender::QMaterial *material, RenderStep *next)
: RenderStep(material, next)
, renderNum(0)
{
}
SceneController::SceneController(QObject *parent)
: QObject(parent)
, scene(new Qt3DCore::QEntity())
, materialsM(new MaterialManager(this))
, lightsM(new LightManager(scene, this))
, cameraM(new CameraManager(scene, this))
, modelM(new ModelManager(scene, this))
, renderM(new RenderManager(scene, this))
, renderEngine(new OffscreenEngine(cameraM->getCamera(), QSize(400, 400)))
, firstRenderStep(nullptr)
, currentRenderStep(nullptr)
{
renderEngine->setSceneRoot(scene);
connect(renderEngine, &OffscreenEngine::imageRendered,
this, &SceneController::acceptRender);
}
void SceneController::setUpRender()
{
delete firstRenderStep;
// delete currentRenderStep;
renderEngine->setSize(renderM->getImageSize());
firstRenderStep = new FirstRenderStep(nullptr, nullptr);
firstRenderStep->renderNum = renderM->getPictureCount();
currentRenderStep = firstRenderStep;
doFirstRenderStep();
}
void SceneController::doFirstRenderStep()
{
if(firstRenderStep->renderNum == 0) {
return;
}
materialsM->randomize();
lightsM->randomize();
cameraM->randomize();
modelM->randomize();
modelM->setMaterial(materialsM->getMainMaterial());
renderEngine->setClearColor(QColor(100, 100, 100, 255));
firstRenderStep->renderNum--;
renderEngine->requestRenderCapture();
}
void SceneController::doNextRenderStep()
{
if(currentRenderStep->nextStep == nullptr) {
doFirstRenderStep();
} else {
currentRenderStep = currentRenderStep->nextStep;
renderEngine->setClearColor(Qt::black);
renderEngine->requestRenderCapture();
}
emit picturesRendered(firstRenderStep->renderNum);
}
void SceneController::acceptRender(QImage img)
{
img.save(renderM->getSavePath()
+ QString::number(firstRenderStep->renderNum)
+ QString(".png"));
doNextRenderStep();
}
ModelEditorWidget::ModelEditorWidget(TextureGenerator *tg, QWidget *parent)
: QWidget(parent)
, treeModel(new SceneTreeModel())
, sceneController(new SceneController(this))
{
setUpLayout();
sceneController->getMaterialsManager()->setTextureGenerator(tg);
treeModel->addItem(sceneController->getMaterialsManager());
treeModel->addItem(sceneController->getModelManager());
treeModel->addItem(sceneController->getCameraManager());
treeModel->addItem(sceneController->getLightsManager());
treeModel->addItem(sceneController->getRenderManager());
}
void ModelEditorWidget::setUpLayout()
{
QVBoxLayout *mainL = new QVBoxLayout();
setLayout(mainL);
QPushButton *renderButton = new QPushButton(tr("Render"));
mainL->addWidget(renderButton);
QHBoxLayout *pLo = new QHBoxLayout();
renderPB = new QProgressBar(this);
QPushButton *pPb = new QPushButton(tr("Cancel"));
pLo->addWidget(renderPB);
pLo->addWidget(pPb);
mainL->addLayout(pLo);
connect(renderButton, &QPushButton::clicked,
sceneController, &SceneController::setUpRender);
connect(renderButton, &QPushButton::clicked,
this, &ModelEditorWidget::setUpForRender);
connect(sceneController, &SceneController::picturesRendered,
this, [this](int num){ renderPB->setValue(renderPB->maximum() - num); });
}
void ModelEditorWidget::setUpForRender()
{
renderPB->setRange(0, sceneController->getRenderManager()->getPictureCount());
renderPB->setValue(0);
}
| [
"eliseev.1999.slava@mail.ru"
] | eliseev.1999.slava@mail.ru |
06ef62f4f68d898fd86752706b8a439108cecf8b | 847c8e7cbc2d7e0b475ed4f8a70bae9c218a45ed | /Assignment/assignment_1operator/arthemetic.cpp | 4ec5ef6478295446052f753e7a83f2f811e2e98a | [] | no_license | bishalkhaniya/cpp_projects | 145a1f249b677b509d2625c433bc26d3ac688712 | ad84e47be485fe0c8ddd9d71884cd6118b55d753 | refs/heads/main | 2023-06-16T19:05:34.972084 | 2021-07-14T04:38:16 | 2021-07-14T04:38:16 | 366,620,011 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 681 | cpp | //Arithmetic Operator
#include<iostream>
int main(){
int number1=10,number2=20;
int result =number1+number2; // operator(addition operator)
std::cout<<"Sum is : "<<result<<std::endl;
result =number2/number1; // operator(division operator)
std::cout<<"Division is : "<<result<<std::endl;
result =number2*number1; // operator(Multiplication operator)
std::cout<<"Multiplication is : "<<result<<std::endl;
result =number1-number2; // operator(subtraction operator)
std::cout<<"Subtraction is : "<<result<<std::endl;
result =number2 % number1; // operator(Modulus operator)
std::cout<<"Remainder is : "<<result<<std::endl;
return 0;
} | [
"bishalkhaniya0404@gmail.com"
] | bishalkhaniya0404@gmail.com |
f31c34ab9b0efe6ea7c3d65f9d23d1d58f08ce87 | 8a971a583606bf6b6b2ed0e7fb9d049ff1dbab90 | /main.cpp | 037ff09c6f5a16dc8e33c3408fc080b527832441 | [] | no_license | JabberSnatch/theRoom | 951d8ed24aa527c5fce2b9e7ec4eb63e05216f40 | 8eca60169d994789778b8c9d03efcaace0a4c696 | refs/heads/master | 2020-06-02T16:49:19.381023 | 2014-10-10T15:44:10 | 2014-10-10T15:44:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,498 | cpp | #include <iostream>
#include "Step.h"
using namespace std;
#TODO (Samu#1#): Add some modularity to the script (i.e. [key|password])
int main () {
Description start = Description("You are standing in a room. On the wall facing you are two doors. One is labeled \"good\" door, and the other one is labeled \"bad\" door. Next to the good door stands a guard. ");
Choice door = Choice("Open the good door", "Open the bad door");
Description goodDoor = Description("Before your hand can reach the doorknob, the guard stops you. He explains that in order to through the good door you first have to search the room for a password and say it to him.");
Description badDoor = Description("As you try to open the bad door, you notice that it is locked. The guard sees you struggling with the door and tells you that he lost the key to the bad door somewhere in the room, and that if you want it, you will have to look for it.");
Description firstLook = Description("You look around and discover that the room is filled with furniture and useless items.");
Choice bookshelf_desk = Choice("Search the bookshelf", "Search the desk");
Description bookshelfDesc = Description("You start browsing through the books. You notice that one of them looks a bit odd, and might be the trigger for some hidden mechanism.");
Choice bookshelfChoi = Choice("Pull the book", "Not pull the book");
Description pullTheBook = Description("You pull the book out of the bookshelf and wait... But nothing happens. Well, at least you've tried.");
Description nPullTheBook = Description("You leave the book where it is and go back to your quest for the [key|password].");
Description deskDesc = Description("The desk is covered in dust. You don't find anything useful on top of it. However, on the top drawer are written the following word : \"There is nothing interesting in there.\"");
Choice deskChoi = Choice("Open the drawer", "Not open the drawer");
Description openTheDrawer = Description("As you open the drawer, you find out that it is filled with wood shavings. You take a few seconds to embrace your own disappointment, and close the drawer back.");
Description nOpenTheDrawer = Description("You leave the drawer as it is, thinking that if it says it is not interesting, then it probably isn't.");
Description secndLook = Description("You are now looking around you, hoping to find other places to search.");
Choice closet_table = Choice("Search the closet", "Search the table");
start.nextStep = &door;
door.xStep = &goodDoor;
door.oStep = &badDoor;
goodDoor.nextStep = &firstLook;
badDoor.nextStep = &firstLook;
firstLook.nextStep = &bookshelf_desk;
bookshelf_desk.xStep = &bookshelfDesc;
bookshelf_desk.oStep = &deskDesc;
bookshelfDesc.nextStep = &bookshelfChoi;
bookshelfChoi.xStep = &pullTheBook;
bookshelfChoi.oStep = &nPullTheBook;
pullTheBook.nextStep = &secndLook;
nPullTheBook.nextStep = &secndLook;
deskDesc.nextStep = &deskChoi;
deskChoi.xStep = &openTheDrawer;
deskChoi.oStep = &nOpenTheDrawer;
openTheDrawer.nextStep = &secndLook;
nOpenTheDrawer.nextStep = &secndLook;
Step* currentStep = &start;
bool running = true;
while (running) {
if (currentStep->hasNext()) {
currentStep = currentStep->runStep();
}
else {
running = false;
currentStep->runStep();
}
}
return 0;
}
| [
"mr.narwall@gmail.com"
] | mr.narwall@gmail.com |
4a491afad1400e3cf13c664b6f494a60261ab206 | bb6ebff7a7f6140903d37905c350954ff6599091 | /chrome/browser/profiles/bookmark_model_loaded_observer.cc | 015ebacc8d27e0d581a557a1b6fc951f6ca41ca2 | [
"BSD-3-Clause"
] | permissive | PDi-Communication-Systems-Inc/lollipop_external_chromium_org | faa6602bd6bfd9b9b6277ce3cd16df0bd26e7f2f | ccadf4e63dd34be157281f53fe213d09a8c66d2c | refs/heads/master | 2022-12-23T18:07:04.568931 | 2016-04-11T16:03:36 | 2016-04-11T16:03:36 | 53,677,925 | 0 | 1 | BSD-3-Clause | 2022-12-09T23:46:46 | 2016-03-11T15:49:07 | C++ | UTF-8 | C++ | false | false | 971 | cc | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "components/bookmarks/browser/bookmark_model.h"
BookmarkModelLoadedObserver::BookmarkModelLoadedObserver(Profile* profile)
: profile_(profile) {
}
void BookmarkModelLoadedObserver::BookmarkModelChanged() {
}
void BookmarkModelLoadedObserver::BookmarkModelLoaded(BookmarkModel* model,
bool ids_reassigned) {
// Causes lazy-load if sync is enabled.
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
model->RemoveObserver(this);
delete this;
}
void BookmarkModelLoadedObserver::BookmarkModelBeingDeleted(
BookmarkModel* model) {
model->RemoveObserver(this);
delete this;
}
| [
"mrobbeloth@pdiarm.com"
] | mrobbeloth@pdiarm.com |
c49b0169f70fd25644e4766fb48362a150b3df43 | db9c1bfff07deec61f9c047ea9d8a82a465e24c4 | /03-qt-study-code/37-QClickWidget/mainwindow.h | 380d8cdb79702d8b3837cccecc85e83aef103d23 | [] | no_license | WeiMuYang/qtcreator-study-202104 | 88666718353c1a0edc77e44463f394ae88a4e29b | 7404c2ab8757e83392a9c99808d1f05688a8f6fc | refs/heads/master | 2023-01-20T18:00:45.861301 | 2020-11-30T15:09:05 | 2020-11-30T15:09:05 | 278,090,213 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 413 | h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "qclickwidget.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
// 2. 定义Widget单击的槽函数
void mouseClickedWidget(QString s);
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
| [
"863255386@qq.com"
] | 863255386@qq.com |
24127e2c06e24c8ad31821a231931dde416f9974 | cb49f3521cdd885ec57b041a439924b66f6cd42f | /CreateFile.cpp | 64f0c05462be2ca5c86784afe08620b5398c2f6c | [] | no_license | isiphonyourgas/ecs60-hw4 | e6e97f76c21f3a5b77a3e621e9784feeef643cf4 | 87b277a6588eab5e48430ac937154f15840a9e38 | refs/heads/master | 2016-09-06T14:55:27.037427 | 2011-05-13T17:44:09 | 2011-05-13T17:44:09 | 1,717,333 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,485 | cpp | /*
* File: CreateFile.cpp
* Author: davis
*
* Created on April 28, 2011, 8:32 PM
*/
#include <cstdlib>
#include <fstream>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cctype>
#include "people.h"
#include "royals.h"
using namespace std;
ifstream& operator>> (ifstream &inf, Person &p)
{
char line[1000];
inf.getline(line, 1000);
if(strlen(line) < 10)
return inf;
strcpy(p.ID, strtok(line, ","));
strcpy(p.name, strtok(NULL, ","));
p.birthYear = atoi(strtok(NULL, ","));
p.deathYear = atoi(strtok(NULL, ","));
p.spouseCount = atoi(strtok(NULL, ","));
for(int i = 0; i < p.spouseCount; i++)
{
strcpy(p.spouseNames[i], strtok(NULL, ","));
p.spouseBirthYears[i] = atoi(strtok(NULL, ","));
p.spouseDeathYears[i] = atoi(strtok(NULL, ","));
p.marriageYears[i] = atoi(strtok(NULL, ","));
} // for i
return inf;
} // operator<<
int readFile(Person *people, int numPeople)
{
ifstream inf("all.csv");
int i = 0;
while(inf >> people[i] && i < numPeople)
i++;
return i;
} // readFile
int main(int argc, char** argv)
{
int count, numPeople, questions, seed, num, num2, answer, birthYear;
char filename[80];
const char *name;
Person person;
Person *people = new Person[7700];
cout << "Number of people (10 - 7681): ";
cin >> numPeople;
cout << "Number of questions (1 - 100000): ";
cin >> questions;
cout << "Seed: ";
cin >> seed;
srand(seed);
count = readFile(people, numPeople);
Royals *royals = new Royals(people, count);
sprintf(filename, "trees-%d-%d-%d.txt", count, questions, seed);
ofstream outf(filename);
outf << count << ' ' << questions << endl;
for(int i = 0; i < questions; i++)
{
switch(rand() % 10)
{
case 0:
num = rand() % count;
answer = royals->getChildren(people[num].name, people[num].birthYear);
outf << 'c' << ',' << people[num].birthYear << ',' << people[num].name
<< ',' << answer << endl;
break;
case 1:
num = rand() % count;
answer = royals->getMarriages(people[num].name, people[num].birthYear);
outf << 'm' << ',' << people[num].birthYear << ',' << people[num].name
<< ',' << answer << endl;
break;
case 2:
num = rand() % count;
answer = royals->getSiblings(people[num].name, people[num].birthYear);
outf << 's' << ',' << people[num].birthYear << ',' << people[num].name
<< ',' << answer << endl;
break;
case 3:
case 4:
case 5:
do
{
num = rand() % count;
royals->getDescendent(people[num].name, people[num].birthYear,
&name, &birthYear);
} while(name == NULL);
outf << 'd' << ',' << people[num].birthYear << ',' << people[num].name
<< ',' << birthYear << ',' << name << endl;
break;
default:
do
{
num = rand() % count;
num2 = rand() % count;
royals->getAncestor(people[num].name, people[num].birthYear,
people[num2].name, people[num2].birthYear, &name, &birthYear);
} while(name == NULL);
outf << 'a' << ','<< people[num].birthYear << ',' << people[num].name
<< ',' << people[num2].birthYear << ',' << people[num2].name
<< ',' << birthYear << ',' << name << endl;
break;
} // switch
} // for each question
outf.close();
return 0;
} // main()
| [
"jcwwong@ucdavis.edu"
] | jcwwong@ucdavis.edu |
7bff0adb177c10537ddb1c663b695bd1887d4dc6 | e39b13327f1202e56899e28c664cf9295c9ae080 | /helli net/3/labi/main.cpp | dc7abcad338bf9402faa23ba849175548551a98a | [] | no_license | Moein-Karami/OlympiadCodes | 08404109b4f0b8109d71d77099cdebc862c0157a | 4c5c5cc1f67464e936ad75aca543629296b224f6 | refs/heads/main | 2023-07-05T03:14:57.495488 | 2021-08-26T06:03:23 | 2021-08-26T06:03:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 609 | cpp | ///EXPERT
#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int main()
{
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++)
cin>>a[i];
int b,c;
for(int i=1;i<=m;i++)
{
cin>>b>>c;
a[c]+=a[b];
a[b]=0;
}
int maxi=0,j=0;
for(int i=1;i<=n;i++)
{
if(a[i]>maxi)
{
maxi=a[i];
j=i;
}
}
int cnt=0;
for(int i=1;i<=n;i++)
if(a[i]==maxi)
cnt++;
if(cnt>1)
cout<<-1;
else
cout<<j;
return 0;
}
| [
"moein2000n@gmail.com"
] | moein2000n@gmail.com |
c2eeec36b007860bc5a472cdde578eff9d34ca45 | edf386ace85dc580b6cba78ec695469ccd8b8127 | /Obj.cpp | 7efb64b2b8d242c971f7c2faa60a26e4b1ed4677 | [] | no_license | Sophiameta/CGBeleg | fd5f7db80b2eddcb2fe114ca6728f36ca77e8eac | 20dfa9040e96e465534519f320b1116652f81935 | refs/heads/master | 2020-04-06T07:09:33.836231 | 2015-04-02T09:09:25 | 2015-04-02T09:09:25 | 31,322,330 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,366 | cpp | #include "Obj.hpp"
#include "objloader.hpp"
#include "texture.hpp"
#include <iostream>
Obj::Obj(const char *modelPath, const char *colorTexturePath) {
this->model = glm::mat4(1);
// mesh
std::vector<glm::vec3> tempVertices;
std::vector<glm::vec2> tempUVs;
std::vector<glm::vec3> tempNormals;
if (loadOBJ(modelPath, tempVertices, tempUVs, tempNormals)) {
glGenVertexArrays(1, &vertexarray);
glBindVertexArray(vertexarray);
vertexcount = tempVertices.size();
// create and bind vertex buffer
glGenBuffers(1, &vertexbuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, tempVertices.size() * sizeof(glm::vec3), &tempVertices[0], GL_STATIC_DRAW);
// bind attributes to vertex array
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (void*)0);
// create and bind UV buffer
glGenBuffers(1, &uvbuffer);
glBindBuffer(GL_ARRAY_BUFFER, uvbuffer);
glBufferData(GL_ARRAY_BUFFER, tempUVs.size() * sizeof(glm::vec2), &tempUVs[0], GL_STATIC_DRAW);
// bind attributes to vertex array
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, (void*)0);
// create and bind normal buffer
glGenBuffers(1, &normalbuffer);
glBindBuffer(GL_ARRAY_BUFFER, normalbuffer);
glBufferData(GL_ARRAY_BUFFER, tempNormals.size() * sizeof(glm::vec3), &tempNormals[0], GL_STATIC_DRAW);
// bind attributes to vertex array
glEnableVertexAttribArray(2);
glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, (void*)0);
glBindVertexArray(0);
}
// textures
colorTexture = loadBMP_custom(colorTexturePath);
}
Obj::~Obj() {
glDeleteBuffers(1, &vertexbuffer);
glDeleteBuffers(1, &normalbuffer);
glDeleteVertexArrays(1, &vertexarray);
glDeleteTextures(1, &colorTexture);
}
void Obj::appendChild(Obj *child) {
this->children.push_back(child);
}
void Obj::removeChild(Obj *child) {
for (int i = 0; i < children.size(); i++) {
if (children[i] == child) {
children.erase(children.begin() + i);
}
}
}
void Obj::drawObject(glm::mat4 projection, glm::mat4 view, glm::mat4 model, GLuint shader) {
// actually used model
glm::mat4 renderModel = model * this->model;
// textures
glEnable( GL_TEXTURE_2D );
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, colorTexture);
glUniform1i(glGetUniformLocation(shader, "colorTextureSampler"), 0);
// enable shading with textures
glUniform1i(glGetUniformLocation(shader, "textureShading"),1 );
// mesh + view
glm::mat4 MVP = projection * view * renderModel;
glBindVertexArray(vertexarray);
glUniformMatrix4fv(glGetUniformLocation(shader, "MVP"), 1, GL_FALSE, &MVP[0][0]);
glUniformMatrix4fv(glGetUniformLocation(shader, "V"), 1, GL_FALSE, &view[0][0]);
glUniformMatrix4fv(glGetUniformLocation(shader, "M"), 1, GL_FALSE, &renderModel[0][0]);
glDrawArrays(GL_TRIANGLES, 0, vertexcount);
glBindVertexArray(0);
glDisable(GL_TEXTURE_2D);
glUniform1i(glGetUniformLocation(shader, "textureShading"),0 ); // disable shading with textures
// drawing child objects, this should be changed to an privarte function so openGL inits like glEnable(GL_TEXTURE_2D) so they arn't called multiple times for no reason
for (int i = 0; i < children.size(); i++) {
children[i]->drawObject(projection, view, renderModel, shader); // model * this->model is important, recursive
}
} | [
"s0540017@htw-berlin.de"
] | s0540017@htw-berlin.de |
9dc757a102d09215422a8e332d12ca2a290a7527 | e9a6b7b8f955f93876c5baf28c6b4757f48aaeef | /model/gates/xorgate.h | 815afc8a625ae756d4497f4f0b6e5503bc97ef89 | [] | no_license | mehr74/LogicSim | f82229f0c77fdd5f351ae69930c9bbbba2a76442 | 330b9c2fc776f13acc2ab7cc89d3379668dd6dde | refs/heads/master | 2021-01-10T06:47:26.291580 | 2016-01-16T12:56:03 | 2016-01-16T12:56:03 | 49,347,761 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 350 | h | #ifndef XORGATE_H
#define XORGATE_H
#include "nmgate.h"
class XorGate : public NMGate
{
public:
XorGate(Wire * in, Wire * in2, Wire * out, const string& name ="");
XorGate(const string& name="");
virtual void Act( );
virtual string tostring() const;
Gate * clone();
private:
static int ourCount;
};
#endif // XORGATE_H
| [
"lotfimehrshad@gmail.com"
] | lotfimehrshad@gmail.com |
d3b2db6c0e60435097fee7fe2f56e72acec73818 | 8cb4dc99186da5aeb35f27a4bb1935506ed0194b | /MyPoco/AppTest_Util/ConfigurationViewTest.cpp | 55ec67483fca8427712a08fdba6fb24b0e80e7c0 | [] | no_license | qianzefeng/CommonProjects | 500e63f0576cdd051a9ebfceb351a1f9fa2b4052 | 84d1cb4c412a3eecf543a1281e212407204ecdee | refs/heads/master | 2020-03-19T05:07:47.752355 | 2019-06-01T11:21:31 | 2019-06-01T11:21:31 | 135,903,167 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,561 | cpp | //
// ConfigurationViewTest.cpp
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "ConfigurationViewTest.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
#include "Util/MapConfiguration.h"
#include "Poco/AutoPtr.h"
#include "Poco/Exception.h"
#include <algorithm>
using Poco::Util::AbstractConfiguration;
using Poco::Util::MapConfiguration;
using Poco::AutoPtr;
ConfigurationViewTest::ConfigurationViewTest(const std::string& name): AbstractConfigurationTest(name)
{
}
ConfigurationViewTest::~ConfigurationViewTest()
{
}
void ConfigurationViewTest::testView()
{
AutoPtr<AbstractConfiguration> pConf = createConfiguration();
AutoPtr<AbstractConfiguration> pView = pConf->createView("");
assert (pView->hasProperty("prop1"));
assert (pView->hasProperty("prop2"));
AbstractConfiguration::Keys keys;
pView->keys(keys);
assert (keys.size() == 13);
assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end());
assert (std::find(keys.begin(), keys.end(), "prop4") != keys.end());
assert (pView->getString("prop1") == "foo");
assert (pView->getString("prop3.string1") == "foo");
pView->setString("prop6", "foobar");
assert (pConf->getString("prop6") == "foobar");
pView = pConf->createView("prop1");
pView->keys(keys);
assert (keys.empty());
assert (pView->hasProperty("prop1"));
pView->setString("prop11", "foobar");
assert (pConf->getString("prop1.prop11") == "foobar");
pView = pConf->createView("prop3");
pView->keys(keys);
assert (keys.size() == 2);
assert (std::find(keys.begin(), keys.end(), "string1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "string2") != keys.end());
assert (pView->getString("string1") == "foo");
assert (pView->getString("string2") == "bar");
pView->setString("string3", "foobar");
assert (pConf->getString("prop3.string3") == "foobar");
pView = pConf->createView("prop5");
pView->keys(keys);
assert (keys.size() == 4);
assert (std::find(keys.begin(), keys.end(), "string1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "string1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "sub1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "sub2") != keys.end());
assert (pView->getString("sub1.string1") == "FOO");
assert (pView->getString("sub2.string2") == "Bar");
pView = pConf->createView("prop5.sub1");
pView->keys(keys);
assert (keys.size() == 2);
assert (std::find(keys.begin(), keys.end(), "string1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "string2") != keys.end());
assert (pView->getString("string1") == "FOO");
assert (pView->getString("string2") == "BAR");
pView->setString("string3", "foobar");
assert (pConf->getString("prop5.sub1.string3") == "foobar");
pView->remove("string3");
assert (!pConf->hasProperty("prop5.sub1.string3"));
}
AbstractConfiguration* ConfigurationViewTest::allocConfiguration() const
{
return new MapConfiguration;
}
void ConfigurationViewTest::setUp()
{
}
void ConfigurationViewTest::tearDown()
{
}
CppUnit::Test* ConfigurationViewTest::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ConfigurationViewTest");
AbstractConfigurationTest_addTests(pSuite, ConfigurationViewTest);
CppUnit_addTest(pSuite, ConfigurationViewTest, testView);
return pSuite;
}
| [
"260202456@qq.com"
] | 260202456@qq.com |
a1992d24b8c74e86b2027022b81c445ee8cf3654 | ae8d344041880c2247ca0b32ac819e25fc2b5fca | /betweeness.cpp | 7d5ce695cff7548bae49df614ce693851b4875c9 | [] | no_license | MohamedAliRashad/Social-Media-Analyzer | f55a22dca8f1bd2329717eef2eb6b2c0c621e45f | 6077fede342543439507edc0da3f9c5c787f6c95 | refs/heads/master | 2020-05-21T10:32:07.423174 | 2019-07-02T18:27:24 | 2019-07-02T18:27:24 | 186,013,395 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,548 | cpp | //
// main.cpp
// graphs
//
// Created by MAK on 5/20/19.
// Copyright © 2019 MAK. All rights reserved.
//
#include <iostream>
#include <queue>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include <iomanip>
#include<list>
using namespace std;
//const int NULL_EDGE = 0;
class GraphType {
private:
int numVertices;
int maxVertices;
int * vertices;
int **edges;
bool* marks;
public:
GraphType(int);
~GraphType();
void AddEdge(int, int, int);
int WeightIs(int,int);
void DepthFirstSearch(int start_vert,int end_vert);
void BreadsFirstSearch(int start_vert,int end_vert);
void ClearMarks();
void GetToVertices(int, queue<int>&);
bool IsMarked(int num){
return marks[num] ? true:false;
}
void MarkVertex(int x){
marks[x]=true;
}
int Closeness(int);
int betweenness();
};
int main() {
int nodes_num,vert_num;
int s,d,w;
cin>>nodes_num>>vert_num;
GraphType g(nodes_num);
for (int i = 0; i < vert_num; ++i)
{ cin>>s>>d>>w;
g.AddEdge(s,d,w);
}
g.betweenness();
return 0;
}
GraphType::GraphType(int maxV) {
numVertices = maxV;
maxVertices = maxV;
vertices = new int[maxV];
edges = new int * [maxV];
for(int i = 0; i < maxV; i++)
edges[i] = new int[maxV];
marks = new bool[maxV];
for (int i = 0; i < maxV; ++i)
{
for (int j = 0; j < maxV; ++j)
{
edges[i][j]=-1;
}
}
}
GraphType::~GraphType() {
delete [] vertices;
for(int i = 0; i < maxVertices; i++)
delete [] edges[i];
delete [] edges;
delete [] marks;
}
void GraphType::AddEdge(int fromVertex,int toVertex,int weight)
{
edges[fromVertex][toVertex] = weight;
edges[toVertex][fromVertex] = weight;
}
int GraphType:: WeightIs(int fromVertex, int toVertex)
{
return edges[fromVertex][toVertex];
}
void GraphType :: ClearMarks(){
for (int i=0 ; i< numVertices; i++) {
marks[i]=false;
}
}
void GraphType :: GetToVertices(int vertex,queue<int>& adjvertexQ)
{
for( int toIndex = 0; toIndex < numVertices; toIndex++)
if(edges[vertex][toIndex] != -1)
adjvertexQ.push(toIndex);
}
void GraphType ::DepthFirstSearch(int start_vert,int end_vert){
stack<int>st;
queue<int>qe;
bool found = false;
int vertex;
int item;
ClearMarks();
MarkVertex(start_vert);
st.push(start_vert);
do{
vertex=st.top();
st.pop();
if(vertex == end_vert)
found = true;
else{
GetToVertices(vertex,qe);
while(!qe.empty()) {
item = qe.front();
qe.pop();
if(!IsMarked(item)){
MarkVertex(item);
st.push(item);
}
}
}
}while( !st.empty() && !found);
if(!found)
cout << "Path not found" << endl;
else
cout<<"founded"<<endl;
}
void GraphType ::BreadsFirstSearch(int start_vert,int end_vert){
queue<int>st;
queue<int>qe;
bool found = false;
int vertex;
int item;
ClearMarks();
MarkVertex(start_vert);
st.push(start_vert);
do{
vertex=st.front();
st.pop();
if(vertex == end_vert)
found = true;
else{
GetToVertices(vertex,qe);
while(!qe.empty()) {
item = qe.front();
qe.pop();
if(!IsMarked(item)){
MarkVertex(item);
st.push(item);
}
}
}
}while( !st.empty() && !found);
if(!found)
cout << "Path not found" << endl;
else
cout<<"founded"<<endl;
}
int GraphType :: Closeness(int sour){
priority_queue< pair<int , pair<int , int> > , vector<pair<int , pair<int , int> > >,
greater< pair<int , pair<int , int> > > > nodes_q ;
vector<int> d(numVertices, 100000000);
vector<int> pp(numVertices, -1);
nodes_q.push(make_pair(0,make_pair(sour,sour)));
while(!nodes_q.empty()){
pair<int , pair<int , int> > p = nodes_q.top ();
nodes_q.pop();
int cur_node = p.second.first ;
int cur_prev_node = p.second.second ;
int cur_dis= p.first;
if (d[cur_node] != 100000000 )
continue ;
pp[cur_node] = cur_prev_node;
d[cur_node] = cur_dis;
for (int i=0; i< numVertices; i++){
if( WeightIs(cur_node,i) != -1)
{
int next_node = i;
int weight = WeightIs(cur_node,i);
if (d[next_node] != 100000000)
continue ;
nodes_q.push(make_pair(cur_dis + weight,make_pair(next_node,cur_node)));
}
}
}
int dist=0;
for (int i=0; i< numVertices; i++){
dist+=d[i];
}
cout<<setprecision(10)<<(double)(numVertices - 1)/dist<<"\n";
return -1;
}
int GraphType ::betweenness(){
priority_queue< pair<int , pair<int , int> > , vector<pair<int , pair<int , int> > >,
greater< pair<int , pair<int , int> > > > nodes_q ;
vector< list <pair<int ,int> > > matr(numVertices);
for (int i = 0; i < numVertices; ++i)
{
vector<int> d(numVertices, 100000000);
vector< list< int > > pp(numVertices);
nodes_q.push(make_pair(0,make_pair(i,i)));
while(!nodes_q.empty()){
pair<int , pair<int , int> > p = nodes_q.top ();
nodes_q.pop();
int cur_node = p.second.first ;
int cur_prev_node = p.second.second ;
int cur_dis= p.first;
if (d[cur_node] == cur_dis )
{
pp[cur_node].push_back(cur_prev_node);
continue;
}
if (d[cur_node] != 100000000 )
continue ;
pp[cur_node].push_back(cur_prev_node);
d[cur_node] = cur_dis;
for (int i=0; i< numVertices; i++){
if( WeightIs(cur_node,i) != -1)
{
int next_node = i;
int weight = WeightIs(cur_node,i);
if (d[next_node] != 100000000)
continue ;
nodes_q.push(make_pair(cur_dis + weight,make_pair(next_node,cur_node)));
}
}
}
for (int i = 0; i < numVertices; ++i)
{
double b=0;
for ( list< int > :: iterator it = pp[i].begin(); it != pp[i].end(); ++it)
{
// cout<<*it<<" ";
}
//cout<<endl;
}
//////////////////////////////////////
for (int k = i+1; k < numVertices; ++k)
{
list<int> :: iterator it;
stack<int> st1 ,st2;
vector<int> path(numVertices,0);
vector<int> counter(numVertices,0);
int path_num=0;
int node;
//path[i]=1;
st1.push(k);
while(!st1.empty()){
node=st1.top();
st1.pop();
st2.push(node);
for (list<int> :: iterator it = pp[node].begin() ; it != pp[node].end(); ++it){
if(*it == i)
continue;
st1.push(*it);
}
}
if (st2.empty())
{
path[k]=1;
continue;
}
while(!st2.empty()){
node=st2.top();
st2.pop();
if(pp[node].size() == 1 && *(pp[node].begin()) == i){
path[node]=1;
counter[node]++;
continue;
}
int num=0;
for (it = pp[node].begin(); it != pp[node].end(); ++it)
{
num+=path[*it];
}
path[node]=num;
counter[node]++;
}
for (int z = 0; z < numVertices ; z++)
{
if (z == i || z==k)
continue;
if (path[z] != 0)
{
pair<int , int >p;
p.first=path[z]*counter[z];
p.second=path[k];
matr[z].push_back(p);
}
}
}
}
for (int i = 0; i < numVertices; ++i)
{
double b=0;
for ( list<pair<int,int> > :: iterator it = matr[i].begin(); it != matr[i].end(); ++it)
{
b+= (double)it->first / it->second ;
//cout<<it->first<<" "<<it->second<<" ";
}
//cout<<endl;
cout<<setprecision(9)<<b<<"\n";
}
return -1;
}
| [
"ahmed299777@gmail.com"
] | ahmed299777@gmail.com |
cbd7c4c4159ca5cc9226dc6874949ca7d39c269f | 1f46da3a0a4825260f32f081ad34cd3def44c836 | /easy/FLOW006/main.cpp | 1ee310884d225121baad9db0b8df54b52f40fa6e | [] | no_license | pratikjagrut/codechef | c906119691c3b9264cf547096b622a79e2786e1d | 9026cf76151e6cdfdce6c601dd61cc5d71486f14 | refs/heads/master | 2022-11-12T07:05:34.650601 | 2020-07-08T06:44:48 | 2020-07-08T06:44:48 | 277,879,354 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 323 | cpp | #include <iostream>
using namespace std;
int main() {
int t, n, sum;
cin >> t;
for (int i = 0; i < t; i++){
cin >> n;
sum=0;
while (n > 0)
{
int digit = n % 10;
n = n / 10;
sum += digit;
}
cout << sum << endl;
}
return 0;
}
| [
"26519653+pratikjagrut@users.noreply.github.com"
] | 26519653+pratikjagrut@users.noreply.github.com |
37720038948d1f2b7768bb8193058d9165cdb803 | 638515faae9ba36041f95e30f7d210c9baf459cc | /Firmware/bdm_kinetis_mk22f/Sources/usb_cdc_uart.h | 480e11813e84abf1e012d4a511279e64f874c327 | [] | no_license | neomissing/usbdm-kinetis | a4dc32596542f2d37a870e6442955c3718205b48 | 7ea27bd74c1b965e7ed206084e28faad9547035a | refs/heads/master | 2020-12-02T22:14:04.709283 | 2017-04-19T02:46:19 | 2017-04-19T02:46:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,329 | h | /**
* @file usb_cdc_uart.h
* @brief USB-UART interface
*
* @version V4.12.1.80
* @date 13 April 2016
*/
#ifndef PROJECT_HEADERS_CDC_UART_H_
#define PROJECT_HEADERS_CDC_UART_H_
#include "pin_mapping.h"
#include "uart.h"
#include "usb_defs.h"
#include "queue.h"
#include "usb.h"
namespace USBDM {
template<class UartInfo>
class CdcUart {
private:
static uint8_t cdcStatus;
static LineCodingStructure lineCoding;
static uint8_t breakCount;
static bool (*inCallback)(uint8_t);
public:
static constexpr uint8_t CDC_STATE_DCD_MASK = 1<<0;
static constexpr uint8_t CDC_STATE_DSR_MASK = 1<<1;
static constexpr uint8_t CDC_STATE_BREAK_IN_MASK = 1<<2;
static constexpr uint8_t CDC_STATE_RI_MASK = 1<<3;
static constexpr uint8_t CDC_STATE_FRAME_MASK = 1<<4;
static constexpr uint8_t CDC_STATE_PARITY_MASK = 1<<5;
static constexpr uint8_t CDC_STATE_OVERRUN_MASK = 1<<6;
static constexpr uint8_t CDC_STATE_CHANGE_MASK = 1<<7;
static constexpr uint8_t CDC_LINE_CONTROL_DTR_MASK = 1<<0;
static constexpr uint8_t CDC_LINE_CONTROL_RTS_MASK = 1<<1;
/**
* Set callback to handle received characters
*
* @param callback Call-back to execute when a serial character is received
*/
static void setInCallback(bool (*callback)(uint8_t)) {
inCallback = callback;
}
/** Queue of outgoing characters */
static Queue<100> outQueue;
/**
* Write character to output queue
*
* @param ch Character to write
*
* @return true => success, false => overrun or similar error
*
* @note The Overrun flag is set on write to full queue
*/
static bool putChar(uint8_t ch) {
if (outQueue.isFull()) {
cdcStatus |= UART_S1_OR_MASK;
return false;
}
outQueue.enQueue(ch);
// Restart Transmit IRQ
UartInfo::uart->C2 |= UART_C2_TIE_MASK;
return true;
}
/**
* Get state of serial interface
*
* @return Bit mask value
*/
static CdcLineState getSerialState() {
static uint8_t lastSciStatus = 0x00;
// Assume DCD & DSR
CdcLineState status = {CDC_STATE_DCD_MASK|CDC_STATE_DSR_MASK};
if (cdcStatus&UART_S1_FE_MASK) {
status.bits |= CDC_STATE_FRAME_MASK;
}
if (cdcStatus&UART_S1_OR_MASK) {
status.bits |= CDC_STATE_OVERRUN_MASK;
}
if (cdcStatus&UART_S1_PF_MASK) {
status.bits |= CDC_STATE_PARITY_MASK;
}
if (lastSciStatus != cdcStatus) {
// Remember error status so we only report changes
lastSciStatus = cdcStatus&(UART_S1_FE_MASK|UART_S1_OR_MASK|UART_S1_PF_MASK);
status.bits |= CDC_STATE_CHANGE_MASK;
}
cdcStatus = 0;
return status;
}
/**
* Set CDC communication characteristics
*
* @param lineCodingStructure - Structure describing desired settings
*
* The CDC is quite limited when compared to the serial interface implied
* by LineCodingStructure.
* It does not support many of the combinations available.
*/
static void setLineCoding(const LineCodingStructure *lineCodingStructure) {
uint8_t UARTC1Value = 0x00;
uint8_t UARTC3Value = 0x00;
// Initialise UART and set baud rate
Uart_T<UartInfo> uart(leToNative32(lineCoding.dwDTERate));
USBDM::UartIrq_T<UartInfo>::setCallback(uartCallback);
cdcStatus = CDC_STATE_CHANGE_MASK;
breakCount = 0; // Clear any current BREAKs
(void)memcpy(&lineCoding, lineCodingStructure, sizeof(LineCodingStructure));
//! Note - for a 48MHz bus speed the useful baud range is ~300 to ~115200 for 0.5% error
// 230400 & 460800 have a 8.5% error
// Configure pins
UartInfo::initPCRs();
// Disable the transmitter and receiver while changing settings.
UartInfo::uart->C2 &= ~(UART_C2_TE_MASK | UART_C2_RE_MASK );
// Note: lineCoding.bCharFormat is ignored (always 1 stop bit)
// switch (lineCoding.bCharFormat) {
// case 0: // 1 bits
// case 1: // 1.5 bits
// case 2: // 2 bits
// }
// Available combinations
//============================================
// Data bits Parity Stop | M PE PT T8
//--------------------------------------------
// 7 Odd 1 | 0 1 1 X
// 7 Even 1 | 0 1 0 X
// 8 None 1 | 0 0 X X
// 8 Odd 1 | 1 1 1 X
// 8 Even 1 | 1 1 0 X
// 8 Mark 1 | 1 0 X 0
// 8 Space 1 | 1 0 X 1
//--------------------------------------------
// All other values default to 8-None-1
switch (lineCoding.bDataBits) {
// 5,6,7,8,16
case 7 :
switch (lineCoding.bParityType) {
case 1: UARTC1Value = UART_C1_PE_MASK|UART_C1_PT_MASK; break; // Odd
case 2: UARTC1Value = UART_C1_PE_MASK; break; // Even
}
break;
case 8 :
UARTC1Value = UART_C1_M_MASK; // 9-data or 8-data+parity
switch (lineCoding.bParityType) {
case 0: UARTC1Value = 0; break; // None
case 1: UARTC1Value |= UART_C1_PE_MASK|UART_C1_PT_MASK; break; // Odd
case 2: UARTC1Value |= UART_C1_PE_MASK; break; // Even
case 3: UARTC3Value = UART_C3_T8_MASK; break; // Mark
case 4: break; // Space
}
break;
default :
break;
}
UartInfo::uart->C1 = UARTC1Value;
UartInfo::uart->C2 =
UART_C2_RIE_MASK| // Receive interrupts (Transmit interrupts enabled when data written)
UART_C2_RE_MASK| // Receiver enable
UART_C2_TE_MASK; // Transmitter enable
UartInfo::uart->C3 = UARTC3Value|
UART_C3_FEIE_MASK| // Framing error
UART_C3_NEIE_MASK| // Noise error
UART_C3_ORIE_MASK| // Overrun error
UART_C3_PEIE_MASK; // Parity error
NVIC_EnableIRQ(UartInfo::irqNums[0]);
}
/**
* Get CDC communication characteristics\n
*
* @return lineCodingStructure - Static structure describing current settings
*/
static const LineCodingStructure *getLineCoding(void) {
return &lineCoding;
}
/**
* Send CDC break\n
*
* @param length Length of break in milliseconds (see note)\n
* - 0x0000 => End BREAK
* - 0xFFFF => Start indefinite BREAK
* - else => Send a break of 10 chars
* @note - only partially implemented
* - breaks are sent after currently queued characters
*/
static void sendBreak(uint16_t length) {
if (length == 0xFFFF) {
// Send indefinite BREAKs
breakCount = 0xFF;
}
else if (length == 0x0) {
// Stop sending BREAKs
breakCount = 0x00;
}
else {
// Queue a series of BREAKs
breakCount = 10;
}
}
/**
* Set CDC Line values
*
* @param value - Describes desired settings
*/
static void setControlLineState(uint8_t value) {
(void) value;
// Not implemented as no control signals
}
/**
* Interrupt callback for UART
*/
static void uartCallback(uint8_t status) {
if (status&UART_S1_RDRF_MASK) {
// Transfers a char from the UART_D to CDC-IN queue
if (!inCallback(UartInfo::uart->D)) {
cdcStatus |= UART_S1_OR_MASK;
}
}
else if (status&UART_S1_TDRE_MASK) {
// Transfer a char from the CDC-OUT queue to UART_D
if (!outQueue.isEmpty()) {
UartInfo::uart->D = outQueue.deQueue(); // Send the char
}
else if (breakCount > 0) {
// Send another BREAK 'char'
UartInfo::uart->C2 |= UART_C2_SBK_MASK;
UartInfo::uart->C2 &= ~UART_C2_SBK_MASK;
if (breakCount != 0xFF) {
breakCount--;
}
}
else {
// No characters available
// Disable further UART transmit interrupts
UartInfo::uart->C2 &= ~UART_C2_TIE_MASK;
}
}
else {
// Record and clear error status
cdcStatus |= status;
if (UartInfo::statusNeedsWrite) {
// Clear error flags
UartInfo::uart->S1 = 0xFF;
}
else {
// Reading data clears flags
(void)UartInfo::uart->D;
}
}
}
};
template<class UartInfo>
uint8_t CdcUart<UartInfo>::breakCount = 0;
template<class UartInfo>
uint8_t CdcUart<UartInfo>::cdcStatus = CdcUart<UartInfo>::CDC_STATE_CHANGE_MASK;
template<class UartInfo>
LineCodingStructure CdcUart<UartInfo>::lineCoding = {leToNative32(9600UL),0,1,8};
template<class UartInfo>
Queue<100> CdcUart<UartInfo>::outQueue;
template<class UartInfo>
bool (*CdcUart<UartInfo>::inCallback)(uint8_t ch);
}; // end namespace USBDM
#endif /* PROJECT_HEADERS_CDC_UART_H_ */
| [
"podonoghue@swin.edu.au"
] | podonoghue@swin.edu.au |
b893aa3c6f13caa8e80183498a7314e88549f730 | 415a8a4315e6331b2a157de8a1429fe0562729f8 | /Cpp/sqlite/example.cpp | 59add79b064d3704d13d529d806726b7d1a985c3 | [] | no_license | alfaceor/programming-examples | 784690dd1104e4adbdf958e4163b3b462f635881 | abea970a54cfab0eacc5280ae62383495e9e6eeb | refs/heads/master | 2022-05-04T23:14:30.503114 | 2022-04-29T10:11:45 | 2022-04-29T10:11:45 | 36,015,541 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 376 | cpp | #include <stdio.h>
#include <sqlite3.h>
int main(int argc, char* argv[])
{
sqlite3 *db;
char *zErrMsg = 0;
int rc;
rc = sqlite3_open("test.db", &db);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
return 0;
}else{
fprintf(stderr, "Opened database successfully\n");
}
sqlite3_close(db);
return 0;
}
| [
"alfaceor"
] | alfaceor |
04e8c29ab43ad2f1c59453bf6add2007cb9d250e | 801b26faa064a91fb9c9fa0a1005942b8597e1c3 | /Extra/Inline Functions/PreprocessorFeatures.cpp | 5fffb6423c38e6a6b3fc3549a202c27c52c5c97f | [] | no_license | remcous/Athabasca-COMP206 | d927bf63ed745b753610786353cc34c1bafa83a4 | 365f159615ec44a1b01cbd26fe132ec73ab3918c | refs/heads/master | 2022-11-16T03:35:57.838655 | 2020-07-14T15:54:34 | 2020-07-14T15:54:34 | 279,628,852 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 366 | cpp | // PreprocessorFeatures.cpp
// String concatenation
#define DEBUG(x) cout << #x " = " << x << endl;
// Stringizing (note this statement used in a one line for loop will only execute the first statement, using a comma instead of a semi colon will correct this)
#define TRACE(s) cerr << #s << endl; s
// Token Pasting
#define FIELD(a) char* a##_string; int a##_size | [
"remcous@gmail.com"
] | remcous@gmail.com |
5ea59a78e9fd5c25cf34a532c3fa6eec28f75d4a | 2cf838b54b556987cfc49f42935f8aa7563ea1f4 | /aws-cpp-sdk-ssm-incidents/include/aws/ssm-incidents/model/UpdateTimelineEventRequest.h | e97d3c9bdfeaf2f5f123be7f6a0d9bc099f75e21 | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | QPC-database/aws-sdk-cpp | d11e9f0ff6958c64e793c87a49f1e034813dac32 | 9f83105f7e07fe04380232981ab073c247d6fc85 | refs/heads/main | 2023-06-14T17:41:04.817304 | 2021-07-09T20:28:20 | 2021-07-09T20:28:20 | 384,714,703 | 1 | 0 | Apache-2.0 | 2021-07-10T14:16:41 | 2021-07-10T14:16:41 | null | UTF-8 | C++ | false | false | 11,437 | h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ssm-incidents/SSMIncidents_EXPORTS.h>
#include <aws/ssm-incidents/SSMIncidentsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/DateTime.h>
#include <utility>
#include <aws/core/utils/UUID.h>
namespace Aws
{
namespace SSMIncidents
{
namespace Model
{
/**
*/
class AWS_SSMINCIDENTS_API UpdateTimelineEventRequest : public SSMIncidentsRequest
{
public:
UpdateTimelineEventRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "UpdateTimelineEvent"; }
Aws::String SerializePayload() const override;
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline const Aws::String& GetClientToken() const{ return m_clientToken; }
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; }
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline void SetClientToken(const Aws::String& value) { m_clientTokenHasBeenSet = true; m_clientToken = value; }
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline void SetClientToken(Aws::String&& value) { m_clientTokenHasBeenSet = true; m_clientToken = std::move(value); }
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline void SetClientToken(const char* value) { m_clientTokenHasBeenSet = true; m_clientToken.assign(value); }
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline UpdateTimelineEventRequest& WithClientToken(const Aws::String& value) { SetClientToken(value); return *this;}
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline UpdateTimelineEventRequest& WithClientToken(Aws::String&& value) { SetClientToken(std::move(value)); return *this;}
/**
* <p>A token ensuring that the action is called only once with the specified
* details.</p>
*/
inline UpdateTimelineEventRequest& WithClientToken(const char* value) { SetClientToken(value); return *this;}
/**
* <p>A short description of the event.</p>
*/
inline const Aws::String& GetEventData() const{ return m_eventData; }
/**
* <p>A short description of the event.</p>
*/
inline bool EventDataHasBeenSet() const { return m_eventDataHasBeenSet; }
/**
* <p>A short description of the event.</p>
*/
inline void SetEventData(const Aws::String& value) { m_eventDataHasBeenSet = true; m_eventData = value; }
/**
* <p>A short description of the event.</p>
*/
inline void SetEventData(Aws::String&& value) { m_eventDataHasBeenSet = true; m_eventData = std::move(value); }
/**
* <p>A short description of the event.</p>
*/
inline void SetEventData(const char* value) { m_eventDataHasBeenSet = true; m_eventData.assign(value); }
/**
* <p>A short description of the event.</p>
*/
inline UpdateTimelineEventRequest& WithEventData(const Aws::String& value) { SetEventData(value); return *this;}
/**
* <p>A short description of the event.</p>
*/
inline UpdateTimelineEventRequest& WithEventData(Aws::String&& value) { SetEventData(std::move(value)); return *this;}
/**
* <p>A short description of the event.</p>
*/
inline UpdateTimelineEventRequest& WithEventData(const char* value) { SetEventData(value); return *this;}
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline const Aws::String& GetEventId() const{ return m_eventId; }
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline bool EventIdHasBeenSet() const { return m_eventIdHasBeenSet; }
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline void SetEventId(const Aws::String& value) { m_eventIdHasBeenSet = true; m_eventId = value; }
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline void SetEventId(Aws::String&& value) { m_eventIdHasBeenSet = true; m_eventId = std::move(value); }
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline void SetEventId(const char* value) { m_eventIdHasBeenSet = true; m_eventId.assign(value); }
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline UpdateTimelineEventRequest& WithEventId(const Aws::String& value) { SetEventId(value); return *this;}
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline UpdateTimelineEventRequest& WithEventId(Aws::String&& value) { SetEventId(std::move(value)); return *this;}
/**
* <p>The ID of the event you are updating. You can find this by using
* <code>ListTimelineEvents</code>.</p>
*/
inline UpdateTimelineEventRequest& WithEventId(const char* value) { SetEventId(value); return *this;}
/**
* <p>The time that the event occurred.</p>
*/
inline const Aws::Utils::DateTime& GetEventTime() const{ return m_eventTime; }
/**
* <p>The time that the event occurred.</p>
*/
inline bool EventTimeHasBeenSet() const { return m_eventTimeHasBeenSet; }
/**
* <p>The time that the event occurred.</p>
*/
inline void SetEventTime(const Aws::Utils::DateTime& value) { m_eventTimeHasBeenSet = true; m_eventTime = value; }
/**
* <p>The time that the event occurred.</p>
*/
inline void SetEventTime(Aws::Utils::DateTime&& value) { m_eventTimeHasBeenSet = true; m_eventTime = std::move(value); }
/**
* <p>The time that the event occurred.</p>
*/
inline UpdateTimelineEventRequest& WithEventTime(const Aws::Utils::DateTime& value) { SetEventTime(value); return *this;}
/**
* <p>The time that the event occurred.</p>
*/
inline UpdateTimelineEventRequest& WithEventTime(Aws::Utils::DateTime&& value) { SetEventTime(std::move(value)); return *this;}
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline const Aws::String& GetEventType() const{ return m_eventType; }
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline bool EventTypeHasBeenSet() const { return m_eventTypeHasBeenSet; }
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline void SetEventType(const Aws::String& value) { m_eventTypeHasBeenSet = true; m_eventType = value; }
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline void SetEventType(Aws::String&& value) { m_eventTypeHasBeenSet = true; m_eventType = std::move(value); }
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline void SetEventType(const char* value) { m_eventTypeHasBeenSet = true; m_eventType.assign(value); }
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline UpdateTimelineEventRequest& WithEventType(const Aws::String& value) { SetEventType(value); return *this;}
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline UpdateTimelineEventRequest& WithEventType(Aws::String&& value) { SetEventType(std::move(value)); return *this;}
/**
* <p>The type of the event. You can update events of type <code>Custom
* Event</code>.</p>
*/
inline UpdateTimelineEventRequest& WithEventType(const char* value) { SetEventType(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline const Aws::String& GetIncidentRecordArn() const{ return m_incidentRecordArn; }
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline bool IncidentRecordArnHasBeenSet() const { return m_incidentRecordArnHasBeenSet; }
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline void SetIncidentRecordArn(const Aws::String& value) { m_incidentRecordArnHasBeenSet = true; m_incidentRecordArn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline void SetIncidentRecordArn(Aws::String&& value) { m_incidentRecordArnHasBeenSet = true; m_incidentRecordArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline void SetIncidentRecordArn(const char* value) { m_incidentRecordArnHasBeenSet = true; m_incidentRecordArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline UpdateTimelineEventRequest& WithIncidentRecordArn(const Aws::String& value) { SetIncidentRecordArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline UpdateTimelineEventRequest& WithIncidentRecordArn(Aws::String&& value) { SetIncidentRecordArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the incident that the timeline event is
* part of.</p>
*/
inline UpdateTimelineEventRequest& WithIncidentRecordArn(const char* value) { SetIncidentRecordArn(value); return *this;}
private:
Aws::String m_clientToken;
bool m_clientTokenHasBeenSet;
Aws::String m_eventData;
bool m_eventDataHasBeenSet;
Aws::String m_eventId;
bool m_eventIdHasBeenSet;
Aws::Utils::DateTime m_eventTime;
bool m_eventTimeHasBeenSet;
Aws::String m_eventType;
bool m_eventTypeHasBeenSet;
Aws::String m_incidentRecordArn;
bool m_incidentRecordArnHasBeenSet;
};
} // namespace Model
} // namespace SSMIncidents
} // namespace Aws
| [
"aws-sdk-cpp-automation@github.com"
] | aws-sdk-cpp-automation@github.com |
d1f706abc05de8aa7c809f1edf5eacebfbba0184 | fe600bf092b637fa2760c46c1a12760558316933 | /preliminaryprocessingofdata.h | 68dfb5022128d1f19b013d508ebe32a545c19d2f | [] | no_license | VlShvets/Visualizer | 80edf0584c5235e06cb6187bb3ce5c00759750b7 | 37946b9d3ca85e9897aad4660d6d925a1b59f604 | refs/heads/master | 2020-05-01T11:25:40.706812 | 2018-08-24T13:57:52 | 2018-08-24T13:57:52 | 177,442,444 | 0 | 1 | null | 2019-03-28T10:03:56 | 2019-03-24T16:48:25 | C++ | UTF-8 | C++ | false | false | 2,142 | h | #ifndef PRELIMINARYPROCESSINGOFDATA_H
#define PRELIMINARYPROCESSINGOFDATA_H
#include "TImit.h"
#include "Poi.h"
namespace Visualizer
{
using namespace BIUS_A100;
/// Класс внутренней предварительной обработки данных
class PreliminaryProcessingOfData
{
public:
explicit PreliminaryProcessingOfData();
~PreliminaryProcessingOfData();
/// Установка указателя на статический массив эталонов
void setTPubEtalon(TPubEtalon *_tPubEtalon);
/// Установка указателя на статический массив сообщений об эталонах
void setTMsgTrc(TMsgTrc *_tMsgTrc);
/// Возвращение указателя на статический массив сообщений об эталонах
inline TUTrcMsg *getTUTrcMsg();
/// Вычислительный процесс
void run(const int _count, const float _currentTime);
private:
/// --------------------------------------------------
/// Указатели на объекты классов
/// --------------------------------------------------
/// Указатели на статические массивы
TPubEtalon *tPubEtalon; /// Указатель на статический массив эталонов
TMsgTrc *tMsgTrc; /// Указатель на статический массив сообщений об эталонах
/// --------------------------------------------------
/// Переменные
/// --------------------------------------------------
/// Статические массивы
TUTrcMsg tUTrcMsg[UGEN_TRC_MAX + 1]; /// Статический массив сообщений об эталонах
};
/// Возвращение указателя на статический массив сообщений об эталонах
TUTrcMsg *PreliminaryProcessingOfData::getTUTrcMsg()
{
return tUTrcMsg;
}
}
#endif // PRELIMINARYPROCESSINGOFDATA_H
| [
"vladimir-shvets@list.ru"
] | vladimir-shvets@list.ru |
3b0deff238f7e93429a4886d59789d2482a7831b | 446a749d41af0008ba557dca6a62c0fbf8fed3ad | /ZOJ/test.cpp | 8b060b3a9fa71386fedad5afc874adff71a5e556 | [] | no_license | Sirivasv/ProgrammingChallenges | b8910f869548491a81e5352f72295a6886cc150e | 5d9039725b2947f392a179f75896b8a57b4537cb | refs/heads/master | 2021-01-12T09:08:15.814557 | 2020-05-15T21:40:14 | 2020-05-15T21:40:14 | 76,768,160 | 0 | 0 | null | 2018-10-13T17:18:12 | 2016-12-18T07:02:21 | C++ | UTF-8 | C++ | false | false | 954 | cpp | #include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<queue>
#define ll long long
#define N 50050
#define INF 999999999
using namespace std;
int n;
int val[N],day[N];
ll dp[N];
struct Que {
ll val,day;
bool operator < (const Que &b)const {
if(val==b.val)return day>b.day;
return val>b.val;
}
};
priority_queue<Que>que;
int main() {
//freopen("test.in","r",stdin);
//debug();
while(cin>>n) {
for(int i=1; i<=n; i++) {
scanf("%d",&val[i]);
}
for(int i=1; i<=n; i++) {
scanf("%d",&day[i]);
}
while(que.size())que.pop();
Que it;
for(int i=1; i<=n; i++) {
it.val=dp[i-1]+val[i],it.day=day[i]+i-1;
while(que.size()&&que.top().day<i)que.pop();
que.push(it);
dp[i]=que.top().val;
}
printf("%lld\n",dp[n]);
}
return 0;
} | [
"saul.ivan.rivas.vega@gmail.com"
] | saul.ivan.rivas.vega@gmail.com |
fe73cc841d063a207a53eee4462dfd2a66dca7c3 | ebb4729814485876fcf7be1790bb71ed741c1b4d | /helper_functions.h | 66058fc9d0e53e498d365fdc0f3517bd4307fa0e | [] | no_license | CS343/Movie-Store | 58e5ea8901ea530c54242a82b637e474a9e08b33 | 5f570b6607855f232a7a75a51a8429625aaa6d58 | refs/heads/master | 2021-01-20T11:29:59.324587 | 2017-06-02T04:48:02 | 2017-06-02T04:48:02 | 83,937,873 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 473 | h | //
// helper_functions.hpp
// movie Store
//
// Created by Danny Ly on 3/5/17.
// Copyright © 2017 Danny Ly. All rights reserved.
//
#ifndef HELPER_FUNCTIONS_H
#define HELPER_FUNCTIONS_H
#include <stdio.h>
#include <vector>
#include <string>
class Helper_Functions{
public:
//helper fucntion to split a specificc string given the paramter
//delimiter
static std::vector<std::string> string_split(std::string, char);
};
#endif /* HELPER_FUNCTIONS_H */
| [
"dannyly199@gmail.com"
] | dannyly199@gmail.com |
446cfb4aa9c7a30b2f5c42dc59cd1abce5b47f75 | 738cb906181d0966a57ca306f21a39b71e6c0487 | /addsouvenir.h | 3283119fa221e7f912eb38f5927a96d71c3535d5 | [] | no_license | awiswasi/AngryNerds | ca9822d3f8d8b0b2c952eef04db576cdcb3ed06f | 3c649eb2e5ea0f6da4c088dc5af993716111aef7 | refs/heads/main | 2023-03-24T16:46:22.278010 | 2021-03-17T22:52:16 | 2021-03-17T22:52:16 | 335,781,700 | 1 | 0 | null | 2021-02-17T22:26:37 | 2021-02-03T23:19:29 | null | UTF-8 | C++ | false | false | 532 | h | #ifndef ADDSOUVENIR_H
#define ADDSOUVENIR_H
#include <QDialog>
#include "dbmanager.h"
#include "confirmpage.h"
namespace Ui {
class addSouvenir;
}
class addSouvenir : public QDialog
{
Q_OBJECT
public:
explicit addSouvenir(QWidget *parent = nullptr);
~addSouvenir();
void updateCombo();
private slots:
void on_pushButton_2_released();
void on_pushButton_released();
private:
Ui::addSouvenir *ui;
DbManager myDb = DbManager(PROJECT_PATH + "/college.db");
};
#endif // ADDSOUVENIR_H
| [
"noreply@github.com"
] | noreply@github.com |
bcfba27ac268c587cc972080d72d45e7f1f37c78 | 1e75aed89cc35b1acea2ad69ca820da6d5cc62fc | /helloProject/helloWorld.cpp | 2ef53c1a1f206295826bafd2f7a02cab8c8321ac | [] | no_license | xiaoyougithub/dataStructure | 95188478c0f8185f693e3606b3d0da9ee7102016 | 9729cea26076128a61ed21d26dd4705d6d452925 | refs/heads/master | 2020-05-18T16:03:34.636430 | 2019-05-02T08:41:24 | 2019-05-02T08:41:24 | 184,515,895 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 159 | cpp | #include<iostream>
using namespace std;
int main(){
int i;
cout<<"hello world"<<endl;
cout<<"请输入一个整数";
cin>>i;
cout<<i<<endl;
return 0;
}
| [
"3220837922@qq.com"
] | 3220837922@qq.com |
30507107c9274ed45f3cbbb461dcf09d7640577d | 6267e69e140022bb0de003de329ffb69d972e661 | /src/Frame.cpp | 2f6decd8145889ca6a0eb6c253719a4de08a2f9d | [] | no_license | newaowen/tankwar | 095911a63f3e18d4a1bf1ea567b5adbf51751330 | e24fbfb2689423d259350c71ca12e06983946b25 | refs/heads/master | 2021-01-23T06:44:39.428758 | 2013-06-28T16:01:49 | 2013-06-28T16:01:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 247 | cpp | /*
* Frame.cpp
*
* by zhanqu
* date 2013-6-25
*/
#include "Frame.h"
namespace Tengine {
Frame::Frame() {
// TODO Auto-generated constructor stub
}
Frame::~Frame() {
// TODO Auto-generated destructor stub
}
} /* namespace Tengine */
| [
"newaowen@yahoo.com.cn"
] | newaowen@yahoo.com.cn |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.