nrvec concatmescaled
This commit is contained in:
parent
c3c155736e
commit
08b6b16e57
9
vec.h
9
vec.h
@ -256,6 +256,15 @@ public:
|
|||||||
resize(nn+rhs.nn,true);
|
resize(nn+rhs.nn,true);
|
||||||
for(int i=0; i<rhs.nn; ++i) v[nnold+i] = rhs[i];
|
for(int i=0; i<rhs.nn; ++i) v[nnold+i] = rhs[i];
|
||||||
}
|
}
|
||||||
|
void concatmescaled(const NRVec &rhs, const T alpha=1)
|
||||||
|
{
|
||||||
|
NOT_GPU(*this);
|
||||||
|
if(rhs.nn==0) return;
|
||||||
|
int nnold=nn;
|
||||||
|
resize(nn+rhs.nn,true);
|
||||||
|
for(int i=0; i<rhs.nn; ++i) v[nnold+i] = rhs[i]*alpha;
|
||||||
|
}
|
||||||
|
|
||||||
void append(const T &a) //not efficient if done repeatedly
|
void append(const T &a) //not efficient if done repeatedly
|
||||||
{
|
{
|
||||||
NOT_GPU(*this);
|
NOT_GPU(*this);
|
||||||
|
Loading…
Reference in New Issue
Block a user