wxSVGMatrix wxSVGMatrix::Multiply(const wxSVGMatrix& secondMatrix) const { wxSVGMatrix res; res.SetA(GetA() * secondMatrix.GetA() + GetC() * secondMatrix.GetB()); res.SetB(GetB() * secondMatrix.GetA() + GetD() * secondMatrix.GetB()); res.SetC(GetA() * secondMatrix.GetC() + GetC() * secondMatrix.GetD()); res.SetD(GetB() * secondMatrix.GetC() + GetD() * secondMatrix.GetD()); res.SetE(GetA() * secondMatrix.GetE() + GetC() * secondMatrix.GetF() + GetE()); res.SetF(GetB() * secondMatrix.GetE() + GetD() * secondMatrix.GetF() + GetF()); return res; }
wxSVGMatrix wxSVGMatrix::Inverse() const { wxSVGMatrix res; double d = 1.0 / (GetA() * GetD() - GetB() * GetC()); res.SetA(GetD() * d); res.SetB(-GetB() * d); res.SetC(-GetC() * d); res.SetD(GetA() * d); res.SetE(-GetE() * res.GetA() - GetF() * res.GetC()); res.SetF(-GetE() * res.GetB() - GetF() * res.GetD()); return res; }
static int d_DB(lua_State *ls) { DISZ80 *d; int b, n, i; d = GetD(ls); n = 0; while (lua_isnumber(ls, n+1)) n++; if (n) { AddToDisTabDB(d); for(i=1; i <= n; i++) { b = luaL_check_long(ls, i) & 0xff; if (i > 1) AddToDis(d, ","); Add8BitNum(d, b); } } return 0; }
static int d_GetPC(lua_State *ls) { DISZ80 *d; d = GetD(ls); lua_pushnumber(ls, (double)d->PC); return 1; }
static int d_GetPass(lua_State *ls) { DISZ80 *d; d = GetD(ls); lua_pushnumber(ls, (double)d->currentPass); return 1; }
//____________________________________________________________________ TH1* One(TDirectory* newDir, TDirectory* oldDir, Double_t c1, Double_t c2) { TString name; name.Form("cent%03dd%02d_%03dd%02d", Int_t(c1), Int_t(c1*100)%100, Int_t(c2), Int_t(c2*100)%100); TDirectory* newSubDir = GetD(newDir, name); TDirectory* oldSubDir = GetD(oldDir, name); if (!newSubDir || !oldSubDir) return 0; Int_t newDim = 0; if (TString(newDir->GetName()).Contains("etaipz")) newDim = 3; else if (TString(newDir->GetName()).Contains("eta")) newDim = 2; else if (TString(newDir->GetName()).Contains("const")) newDim = 1; Int_t oldDim = 0; if (TString(oldDir->GetName()).Contains("etaipz")) oldDim = 3; else if (TString(oldDir->GetName()).Contains("eta")) oldDim = 2; else if (TString(oldDir->GetName()).Contains("const")) oldDim = 1; TDirectory* newSubSubDir = GetD(newSubDir, Form("results%dd",newDim)); TDirectory* oldSubSubDir = GetD(oldSubDir, Form("results%dd",oldDim)); if (!newSubSubDir || !oldSubSubDir) return 0; TH1* newRes = GetH1(newSubSubDir, "result"); TH1* oldRes = GetH1(oldSubSubDir, "result"); if (!newRes || !oldRes) return 0; TH1* ratio = static_cast<TH1*>(newRes->Clone(name)); ratio->SetDirectory(0); ratio->SetTitle(Form("%5.1f - %5.1f%%", c1, c2)); ratio->SetYTitle("New / Old"); ratio->Divide(oldRes); fMin = TMath::Min(fMin, ratio->GetMinimum()); fMax = TMath::Max(fMax, ratio->GetMaximum()); Printf("Calculated %s/%s", newDir->GetName(), oldDir->GetName()); if (!fLegend) return ratio; TLegendEntry* e = fLegend->AddEntry("", Form("%3.0f - %3.0f%%", c1, c2), "f"); e->SetFillStyle(1001); e->SetFillColor(ratio->GetMarkerColor()); return ratio; }
LLBC_MD5::MD5GroupDigest &LLBC_MD5::MD5GroupDigest::operator +=(const LLBC_MD5::MD5GroupDigest &right) { SetA(GetA() + right.GetA()); SetB(GetB() + right.GetB()); SetC(GetC() + right.GetC()); SetD(GetD() + right.GetD()); return *this; }
static int d_Message(lua_State *ls) { DISZ80 *d; const char *ps; ps = luaL_check_string(ls, 1); d = GetD(ls); dZ80_ShowMsg(d, (char *)ps); return 0; }
static int d_FlushLine(lua_State *ls) { DISZ80 *d; int err; d = GetD(ls); err = WriteDisLine(d, d->lastPC); lua_pushnumber(ls, (double)err); return 1; }
static int d_LookByteAddr(lua_State *ls) { DISZ80 *d; int addr; d = GetD(ls); addr = luaL_check_long(ls, 1); lua_pushnumber(ls, (double)d->Z80MemBase[addr]); return 1; }
static int d_AddToDisTab(lua_State *ls) { DISZ80 *d; const char *str; size_t len; d = GetD(ls); str = luaL_check_lstr(ls, 1, &len); AddToDisTab(d, (char *)str); return 0; }
void PIDController::InitTable(std::shared_ptr<ITable> table) { if (m_table != nullptr) m_table->RemoveTableListener(this); m_table = table; if (m_table != nullptr) { m_table->PutNumber(kP, GetP()); m_table->PutNumber(kI, GetI()); m_table->PutNumber(kD, GetD()); m_table->PutNumber(kF, GetF()); m_table->PutNumber(kSetpoint, GetSetpoint()); m_table->PutBoolean(kEnabled, IsEnabled()); m_table->AddTableListener(this, false); } }
static int d_LookByte(lua_State *ls) { DISZ80 *d; BYTE b; int offset; d = GetD(ls); offset = luaL_check_long(ls, 1); b = LookOpcode(d, offset); lua_pushnumber(ls, (double)b); return 1; }
static int d_GetByte(lua_State *ls) { DISZ80 *d; BYTE b; d = GetD(ls); if (!WithinDisRange(d)) lua_error(ls, "d_GetByte requesting a byte past the user end address"); b = GetNextOpCode(d); lua_pushnumber(ls, (double)b); return 1; }
static int d_RegTrap(lua_State *ls) { DISZ80 *d; int op, type; d = GetD(ls); op = luaL_check_long(ls, 1); assert(op >= 0 && op < 256); type = luaL_check_long(ls, 2); d->pTrapMap[op] |= (unsigned char)type; return 0; }
int LuaErrorHandler(lua_State *ls) { char buf[256]; DISZ80 *d; const char *s; d = GetD(ls); s = lua_tostring(ls, 1); if (s == NULL) s = "(no message)"; sprintf(buf, "Script error: %s\n", s); dZ80_Error(d, buf); return 0; }
NetworkTable* PIDJaguar::GetTable() { if (m_table == NULL) { m_table = new NetworkTable(); m_table->PutDouble(kP, GetP()); m_table->PutDouble(kI, GetI()); m_table->PutDouble(kD, GetD()); m_table->PutDouble(kSetpoint, Get()); m_table->PutBoolean(kEnabled, m_bEnabled); m_table->AddChangeListenerAny(this); } return m_table; }
static int d_IsCodeByte(lua_State *ls) { DISZ80 *d; int addr, isCodeByte; isCodeByte = 1; d = GetD(ls); addr = luaL_check_long(ls, 1); if (d->opMap != NULL) { if (!ISCODEBYTE(d, addr)) isCodeByte = 0; } lua_pushnumber(ls, (double)isCodeByte); return 1; }
int compare(const char* filename){ classWithComplex cref(1,2,3,4); classWithComplex ccref(11,22,33,44); auto f = TFile::Open(filename); auto c = (classWithComplex*)f->Get("classWithComplex1"); auto cc = (classWithComplex*)f->Get("classWithComplex2"); if (*c != cref && *cc != ccref){ cout << "ERROR The objects on file differ from the references!\n" << cref.GetF() << ", " << cref.GetD() << " vs onfile " << c->GetF() << ", " << c->GetD() << endl << ccref.GetF() << ", " << ccref.GetD() << " vs onfile " << cc->GetF() << ", " << cc->GetD() << endl; return 1; } return 0; }