Menu

[r131]: / trunk / include / drovector- / drovector-cast.hpp  Maximize  Restore  History

Download this file

36 lines (29 with data), 907 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//=============================================================================
/*! cast to _zrovector */
inline _zrovector drovector::to_zrovector() const
{VERBOSE_REPORT;
zrovector newvec(l);
for(long i=0; i<l; i++){
newvec.array[i] =comple(array[i], 0.);
}
return _(newvec);
}
//=============================================================================
/*! cast to drovector_small */
template<long _l>
inline drovector_small<_l> drovector::to_drovector_small() const
{VERBOSE_REPORT;
#ifdef CPPL_DEBUG
if( l!=_l ){
std::cerr << "[ERROR]@drovector::to_drovector_small() const" << std::endl
<< "size mismatch." << std::endl
<< "Your input was from (" << l << ") to (" << _l << ")." << std::endl;
exit(1);
}
#endif//CPPL_DEBUG
drovector_small<_l> newvec;
for(long i=0; i<l; i++){
newvec(i) =(*this)(i);
}
return newvec;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.