diff options
author | Karl Berry <karl@freefriends.org> | 2010-07-04 17:26:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-07-04 17:26:20 +0000 |
commit | 15807e15ade01ea275cb91ba5ea6b660b996406f (patch) | |
tree | d929429372f1984140fc0384c2fb73e4845a48a8 /Build/source/utils/asymptote/runtime.cc | |
parent | ea6aa8ed9ddfe75f76b6bf23e5b8737230be98e7 (diff) |
asy 2.00
git-svn-id: svn://tug.org/texlive/trunk@19227 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/runtime.cc')
-rw-r--r-- | Build/source/utils/asymptote/runtime.cc | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/Build/source/utils/asymptote/runtime.cc b/Build/source/utils/asymptote/runtime.cc index 85a95180771..1fb85676c60 100644 --- a/Build/source/utils/asymptote/runtime.cc +++ b/Build/source/utils/asymptote/runtime.cc @@ -63,52 +63,6 @@ array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); -inline size_t checkdimension(const array *a, size_t dim) -{ - size_t size=checkArray(a); - if(dim && size != dim) { - ostringstream buf; - buf << "array of length " << dim << " expected"; - error(buf); - } - return size; -} - -template<class T> -void copyArrayC(T* &dest, const array *a, size_t dim=0, - GCPlacement placement=NoGC) -{ - size_t size=checkdimension(a,dim); - dest=(placement == NoGC) ? new T[size] : new(placement) T[size]; - for(size_t i=0; i < size; i++) - dest[i]=read<T>(a,i); -} - -template<class T> -void copyArray2C(T* &dest, const array *a, bool square=true, size_t dim2=0, - GCPlacement placement=NoGC) -{ - size_t n=checkArray(a); - size_t m=(square || n == 0) ? n : checkArray(read<array*>(a,0)); - if(n > 0 && dim2 && m != dim2) { - ostringstream buf; - buf << "second matrix dimension must be " << dim2; - error(buf); - } - - dest=(placement == NoGC) ? new T[n*m] : new(placement) T[n*m]; - for(size_t i=0; i < n; i++) { - array *ai=read<array*>(a,i); - size_t aisize=checkArray(ai); - if(aisize == m) { - T *desti=dest+i*m; - for(size_t j=0; j < m; j++) - desti[j]=read<T>(ai,j); - } else - error(square ? "matrix must be square" : "matrix must be rectangular"); - } -} - double *copyTripleArray2Components(array *a, bool square=true, size_t dim2=0, GCPlacement placement=NoGC); } @@ -279,8 +233,10 @@ void unused(void *) +#ifndef NOSYM #include "runtime.symbols.h" +#endif namespace run { // Initializers |