/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DetectorDescription/Core/src/DDVector.cc
36 строк
1 KB
Cms Build
Clang-Format
29 май 2019, 08:28
29 май 2019, 08:28
96591f2
Код
Авторство
О чём код?
#include "DetectorDescription/Core/interface/DDVector.h" #include <utility> DDVector::DDVector() : DDBase<DDName, std::unique_ptr<std::vector<double>>>() {} DDVector::DDVector(const DDName& name) : DDBase<DDName, std::unique_ptr<std::vector<double>>>() { create(name); } DDVector::DDVector(const DDName& name, std::unique_ptr<std::vector<double>> vals) { create(name, std::move(vals)); } std::ostream& operator<<(std::ostream& os, const DDVector& cons) { os << "DDVector name=" << cons.name(); if (cons.isDefined().second) { os << " size=" << cons.size() << " vals=( "; DDVector::value_type::const_iterator it(cons.values().begin()), ed(cons.values().end()); for (; it < ed; ++it) { os << *it << ' '; } os << ')'; } else { os << " constant is not yet defined, only declared."; } return os; } DDVector::operator std::vector<int>() const { std::vector<int> result(rep().size()); std::vector<int>::size_type sz = 0; std::vector<double>::const_iterator it(rep().begin()), ed(rep().end()); for (; it != ed; ++it) { result[sz] = int(*it); ++sz; } return result; }