45 #ifndef ROL_VECTORWORKSPACE_HPP
46 #define ROL_VECTORWORKSPACE_HPP
100 template<
typename Real>
114 hash_code(typeid(x).hash_code()),
115 dimension( x.dimension() ) {}
122 ss <<
"VectorKey(" << hex << key.
hash_code <<
","
156 for(
auto v : vectors_ ) count += ( getCount(v) > 3 );
167 "VectorWorkspace::VectorStack tried to clone a vector of type " <<
168 hex << key_.
hash_code <<
", but it can only clone vectors of type " <<
172 "VectorWorkspace::VectorStack tried to clone a vector of dimension " <<
173 hex << key_.
dimension <<
", but it can only clone vectors of dimension " <<
176 for(
auto e : vectors_ ) {
177 if( getCount(e) <= 2 ) {
183 vectors_.push_back( v );
189 vector<size_type> counts;
190 for(
auto e: vectors_ ) counts.push_back( getCount(e) );
204 Ptr<VectorStack> vstack{nullPtr};
206 for(
auto e :
workspace_ ) key_count += (key == e.first);
208 if( key_count == 0 ) {
209 vstack = makePtr<VectorStack>(x);
214 return vstack->clone(x);
226 Ptr<V>
copy(
const Ptr<const V>& x ) {
return copy(*x); }
229 os <<
"\n\n" << string(80,
'-') << std::endl;
230 os <<
"VectorWorkspace contains the following VectorStack(hash_code,dim) entries:\n\n";
232 os <<
" VectorStack(" << hex << entry.first.hash_code <<
","
233 << dec << entry.first.dimension <<
")";
234 os <<
"\n Reference Counts per element" << std::endl;
235 for(
auto e : entry.second->vectors_ ) {
236 os <<
" " << getCount( e ) << std::endl;
239 os << string(80,
'-') << std::endl;