Mercurial > octave
comparison liboctave/array/idx-vector.cc @ 15271:648dabbb4c6b
build: Refactor liboctave into multiple subdirectories. Move libcruft into liboctave.
* array/Array-C.cc, array/Array-b.cc, array/Array-ch.cc, array/Array-d.cc,
array/Array-f.cc, array/Array-fC.cc, array/Array-i.cc, array/Array-idx-vec.cc,
array/Array-s.cc, array/Array-str.cc, array/Array-util.cc, array/Array-util.h,
array/Array-voidp.cc, array/Array.cc, array/Array.h, array/Array2.h,
array/Array3.h, array/ArrayN.h, array/CColVector.cc, array/CColVector.h,
array/CDiagMatrix.cc, array/CDiagMatrix.h, array/CMatrix.cc, array/CMatrix.h,
array/CNDArray.cc, array/CNDArray.h, array/CRowVector.cc, array/CRowVector.h,
array/CSparse.cc, array/CSparse.h, array/DiagArray2.cc, array/DiagArray2.h,
array/MArray-C.cc, array/MArray-d.cc, array/MArray-decl.h, array/MArray-defs.h,
array/MArray-f.cc, array/MArray-fC.cc, array/MArray-i.cc, array/MArray-s.cc,
array/MArray.cc, array/MArray.h, array/MArray2.h, array/MArrayN.h,
array/MDiagArray2.cc, array/MDiagArray2.h, array/MSparse-C.cc,
array/MSparse-d.cc, array/MSparse-defs.h, array/MSparse.cc, array/MSparse.h,
array/Matrix.h, array/MatrixType.cc, array/MatrixType.h, array/PermMatrix.cc,
array/PermMatrix.h, array/Range.cc, array/Range.h, array/Sparse-C.cc,
array/Sparse-b.cc, array/Sparse-d.cc, array/Sparse.cc, array/Sparse.h,
array/boolMatrix.cc, array/boolMatrix.h, array/boolNDArray.cc,
array/boolNDArray.h, array/boolSparse.cc, array/boolSparse.h,
array/chMatrix.cc, array/chMatrix.h, array/chNDArray.cc, array/chNDArray.h,
array/dColVector.cc, array/dColVector.h, array/dDiagMatrix.cc,
array/dDiagMatrix.h, array/dMatrix.cc, array/dMatrix.h, array/dNDArray.cc,
array/dNDArray.h, array/dRowVector.cc, array/dRowVector.h, array/dSparse.cc,
array/dSparse.h, array/dim-vector.cc, array/dim-vector.h, array/fCColVector.cc,
array/fCColVector.h, array/fCDiagMatrix.cc, array/fCDiagMatrix.h,
array/fCMatrix.cc, array/fCMatrix.h, array/fCNDArray.cc, array/fCNDArray.h,
array/fCRowVector.cc, array/fCRowVector.h, array/fColVector.cc,
array/fColVector.h, array/fDiagMatrix.cc, array/fDiagMatrix.h,
array/fMatrix.cc, array/fMatrix.h, array/fNDArray.cc, array/fNDArray.h,
array/fRowVector.cc, array/fRowVector.h, array/idx-vector.cc,
array/idx-vector.h, array/int16NDArray.cc, array/int16NDArray.h,
array/int32NDArray.cc, array/int32NDArray.h, array/int64NDArray.cc,
array/int64NDArray.h, array/int8NDArray.cc, array/int8NDArray.h,
array/intNDArray.cc, array/intNDArray.h, array/module.mk,
array/uint16NDArray.cc, array/uint16NDArray.h, array/uint32NDArray.cc,
array/uint32NDArray.h, array/uint64NDArray.cc, array/uint64NDArray.h,
array/uint8NDArray.cc, array/uint8NDArray.h:
Moved from liboctave dir to array subdirectory.
* cruft/Makefile.am, cruft/amos/README, cruft/amos/cacai.f, cruft/amos/cacon.f,
cruft/amos/cairy.f, cruft/amos/casyi.f, cruft/amos/cbesh.f, cruft/amos/cbesi.f,
cruft/amos/cbesj.f, cruft/amos/cbesk.f, cruft/amos/cbesy.f, cruft/amos/cbinu.f,
cruft/amos/cbiry.f, cruft/amos/cbknu.f, cruft/amos/cbuni.f, cruft/amos/cbunk.f,
cruft/amos/ckscl.f, cruft/amos/cmlri.f, cruft/amos/crati.f, cruft/amos/cs1s2.f,
cruft/amos/cseri.f, cruft/amos/cshch.f, cruft/amos/cuchk.f, cruft/amos/cunhj.f,
cruft/amos/cuni1.f, cruft/amos/cuni2.f, cruft/amos/cunik.f, cruft/amos/cunk1.f,
cruft/amos/cunk2.f, cruft/amos/cuoik.f, cruft/amos/cwrsk.f,
cruft/amos/dgamln.f, cruft/amos/gamln.f, cruft/amos/module.mk,
cruft/amos/xzabs.f, cruft/amos/xzexp.f, cruft/amos/xzlog.f,
cruft/amos/xzsqrt.f, cruft/amos/zacai.f, cruft/amos/zacon.f,
cruft/amos/zairy.f, cruft/amos/zasyi.f, cruft/amos/zbesh.f, cruft/amos/zbesi.f,
cruft/amos/zbesj.f, cruft/amos/zbesk.f, cruft/amos/zbesy.f, cruft/amos/zbinu.f,
cruft/amos/zbiry.f, cruft/amos/zbknu.f, cruft/amos/zbuni.f, cruft/amos/zbunk.f,
cruft/amos/zdiv.f, cruft/amos/zkscl.f, cruft/amos/zmlri.f, cruft/amos/zmlt.f,
cruft/amos/zrati.f, cruft/amos/zs1s2.f, cruft/amos/zseri.f, cruft/amos/zshch.f,
cruft/amos/zuchk.f, cruft/amos/zunhj.f, cruft/amos/zuni1.f, cruft/amos/zuni2.f,
cruft/amos/zunik.f, cruft/amos/zunk1.f, cruft/amos/zunk2.f, cruft/amos/zuoik.f,
cruft/amos/zwrsk.f, cruft/blas-xtra/cconv2.f, cruft/blas-xtra/cdotc3.f,
cruft/blas-xtra/cmatm3.f, cruft/blas-xtra/csconv2.f, cruft/blas-xtra/dconv2.f,
cruft/blas-xtra/ddot3.f, cruft/blas-xtra/dmatm3.f, cruft/blas-xtra/module.mk,
cruft/blas-xtra/sconv2.f, cruft/blas-xtra/sdot3.f, cruft/blas-xtra/smatm3.f,
cruft/blas-xtra/xcdotc.f, cruft/blas-xtra/xcdotu.f, cruft/blas-xtra/xddot.f,
cruft/blas-xtra/xdnrm2.f, cruft/blas-xtra/xdznrm2.f, cruft/blas-xtra/xerbla.f,
cruft/blas-xtra/xscnrm2.f, cruft/blas-xtra/xsdot.f, cruft/blas-xtra/xsnrm2.f,
cruft/blas-xtra/xzdotc.f, cruft/blas-xtra/xzdotu.f, cruft/blas-xtra/zconv2.f,
cruft/blas-xtra/zdconv2.f, cruft/blas-xtra/zdotc3.f, cruft/blas-xtra/zmatm3.f,
cruft/daspk/datv.f, cruft/daspk/dcnst0.f, cruft/daspk/dcnstr.f,
cruft/daspk/ddasic.f, cruft/daspk/ddasid.f, cruft/daspk/ddasik.f,
cruft/daspk/ddaspk.f, cruft/daspk/ddstp.f, cruft/daspk/ddwnrm.f,
cruft/daspk/dfnrmd.f, cruft/daspk/dfnrmk.f, cruft/daspk/dhels.f,
cruft/daspk/dheqr.f, cruft/daspk/dinvwt.f, cruft/daspk/dlinsd.f,
cruft/daspk/dlinsk.f, cruft/daspk/dmatd.f, cruft/daspk/dnedd.f,
cruft/daspk/dnedk.f, cruft/daspk/dnsd.f, cruft/daspk/dnsid.f,
cruft/daspk/dnsik.f, cruft/daspk/dnsk.f, cruft/daspk/dorth.f,
cruft/daspk/dslvd.f, cruft/daspk/dslvk.f, cruft/daspk/dspigm.f,
cruft/daspk/dyypnw.f, cruft/daspk/module.mk, cruft/dasrt/ddasrt.f,
cruft/dasrt/drchek.f, cruft/dasrt/droots.f, cruft/dasrt/module.mk,
cruft/dassl/ddaini.f, cruft/dassl/ddajac.f, cruft/dassl/ddanrm.f,
cruft/dassl/ddaslv.f, cruft/dassl/ddassl.f, cruft/dassl/ddastp.f,
cruft/dassl/ddatrp.f, cruft/dassl/ddawts.f, cruft/dassl/module.mk,
cruft/fftpack/cfftb.f, cruft/fftpack/cfftb1.f, cruft/fftpack/cfftf.f,
cruft/fftpack/cfftf1.f, cruft/fftpack/cffti.f, cruft/fftpack/cffti1.f,
cruft/fftpack/fftpack.doc, cruft/fftpack/module.mk, cruft/fftpack/passb.f,
cruft/fftpack/passb2.f, cruft/fftpack/passb3.f, cruft/fftpack/passb4.f,
cruft/fftpack/passb5.f, cruft/fftpack/passf.f, cruft/fftpack/passf2.f,
cruft/fftpack/passf3.f, cruft/fftpack/passf4.f, cruft/fftpack/passf5.f,
cruft/fftpack/zfftb.f, cruft/fftpack/zfftb1.f, cruft/fftpack/zfftf.f,
cruft/fftpack/zfftf1.f, cruft/fftpack/zffti.f, cruft/fftpack/zffti1.f,
cruft/fftpack/zpassb.f, cruft/fftpack/zpassb2.f, cruft/fftpack/zpassb3.f,
cruft/fftpack/zpassb4.f, cruft/fftpack/zpassb5.f, cruft/fftpack/zpassf.f,
cruft/fftpack/zpassf2.f, cruft/fftpack/zpassf3.f, cruft/fftpack/zpassf4.f,
cruft/fftpack/zpassf5.f, cruft/lapack-xtra/crsf2csf.f,
cruft/lapack-xtra/module.mk, cruft/lapack-xtra/xclange.f,
cruft/lapack-xtra/xdlamch.f, cruft/lapack-xtra/xdlange.f,
cruft/lapack-xtra/xilaenv.f, cruft/lapack-xtra/xslamch.f,
cruft/lapack-xtra/xslange.f, cruft/lapack-xtra/xzlange.f,
cruft/lapack-xtra/zrsf2csf.f, cruft/link-deps.mk, cruft/misc/blaswrap.c,
cruft/misc/cquit.c, cruft/misc/d1mach-tst.for, cruft/misc/d1mach.f,
cruft/misc/f77-extern.cc, cruft/misc/f77-fcn.c, cruft/misc/f77-fcn.h,
cruft/misc/i1mach.f, cruft/misc/lo-error.c, cruft/misc/lo-error.h,
cruft/misc/module.mk, cruft/misc/quit.cc, cruft/misc/quit.h,
cruft/misc/r1mach.f, cruft/mkf77def.in, cruft/odepack/cfode.f,
cruft/odepack/dlsode.f, cruft/odepack/ewset.f, cruft/odepack/intdy.f,
cruft/odepack/module.mk, cruft/odepack/prepj.f, cruft/odepack/scfode.f,
cruft/odepack/sewset.f, cruft/odepack/sintdy.f, cruft/odepack/slsode.f,
cruft/odepack/solsy.f, cruft/odepack/sprepj.f, cruft/odepack/ssolsy.f,
cruft/odepack/sstode.f, cruft/odepack/stode.f, cruft/odepack/svnorm.f,
cruft/odepack/vnorm.f, cruft/ordered-qz/README, cruft/ordered-qz/dsubsp.f,
cruft/ordered-qz/exchqz.f, cruft/ordered-qz/module.mk,
cruft/ordered-qz/sexchqz.f, cruft/ordered-qz/ssubsp.f, cruft/quadpack/dqagi.f,
cruft/quadpack/dqagie.f, cruft/quadpack/dqagp.f, cruft/quadpack/dqagpe.f,
cruft/quadpack/dqelg.f, cruft/quadpack/dqk15i.f, cruft/quadpack/dqk21.f,
cruft/quadpack/dqpsrt.f, cruft/quadpack/module.mk, cruft/quadpack/qagi.f,
cruft/quadpack/qagie.f, cruft/quadpack/qagp.f, cruft/quadpack/qagpe.f,
cruft/quadpack/qelg.f, cruft/quadpack/qk15i.f, cruft/quadpack/qk21.f,
cruft/quadpack/qpsrt.f, cruft/quadpack/xerror.f, cruft/ranlib/Basegen.doc,
cruft/ranlib/HOWTOGET, cruft/ranlib/README, cruft/ranlib/advnst.f,
cruft/ranlib/genbet.f, cruft/ranlib/genchi.f, cruft/ranlib/genexp.f,
cruft/ranlib/genf.f, cruft/ranlib/gengam.f, cruft/ranlib/genmn.f,
cruft/ranlib/genmul.f, cruft/ranlib/gennch.f, cruft/ranlib/gennf.f,
cruft/ranlib/gennor.f, cruft/ranlib/genprm.f, cruft/ranlib/genunf.f,
cruft/ranlib/getcgn.f, cruft/ranlib/getsd.f, cruft/ranlib/ignbin.f,
cruft/ranlib/ignlgi.f, cruft/ranlib/ignnbn.f, cruft/ranlib/ignpoi.f,
cruft/ranlib/ignuin.f, cruft/ranlib/initgn.f, cruft/ranlib/inrgcm.f,
cruft/ranlib/lennob.f, cruft/ranlib/mltmod.f, cruft/ranlib/module.mk,
cruft/ranlib/phrtsd.f, cruft/ranlib/qrgnin.f, cruft/ranlib/randlib.chs,
cruft/ranlib/randlib.fdoc, cruft/ranlib/ranf.f, cruft/ranlib/setall.f,
cruft/ranlib/setant.f, cruft/ranlib/setgmn.f, cruft/ranlib/setsd.f,
cruft/ranlib/sexpo.f, cruft/ranlib/sgamma.f, cruft/ranlib/snorm.f,
cruft/ranlib/tstbot.for, cruft/ranlib/tstgmn.for, cruft/ranlib/tstmid.for,
cruft/ranlib/wrap.f, cruft/slatec-err/fdump.f, cruft/slatec-err/ixsav.f,
cruft/slatec-err/j4save.f, cruft/slatec-err/module.mk,
cruft/slatec-err/xerclr.f, cruft/slatec-err/xercnt.f,
cruft/slatec-err/xerhlt.f, cruft/slatec-err/xermsg.f,
cruft/slatec-err/xerprn.f, cruft/slatec-err/xerrwd.f,
cruft/slatec-err/xersve.f, cruft/slatec-err/xgetf.f, cruft/slatec-err/xgetua.f,
cruft/slatec-err/xsetf.f, cruft/slatec-err/xsetua.f, cruft/slatec-fn/acosh.f,
cruft/slatec-fn/albeta.f, cruft/slatec-fn/algams.f, cruft/slatec-fn/alngam.f,
cruft/slatec-fn/alnrel.f, cruft/slatec-fn/asinh.f, cruft/slatec-fn/atanh.f,
cruft/slatec-fn/betai.f, cruft/slatec-fn/csevl.f, cruft/slatec-fn/d9gmit.f,
cruft/slatec-fn/d9lgic.f, cruft/slatec-fn/d9lgit.f, cruft/slatec-fn/d9lgmc.f,
cruft/slatec-fn/dacosh.f, cruft/slatec-fn/dasinh.f, cruft/slatec-fn/datanh.f,
cruft/slatec-fn/dbetai.f, cruft/slatec-fn/dcsevl.f, cruft/slatec-fn/derf.f,
cruft/slatec-fn/derfc.in.f, cruft/slatec-fn/dgami.f, cruft/slatec-fn/dgamit.f,
cruft/slatec-fn/dgamlm.f, cruft/slatec-fn/dgamma.f, cruft/slatec-fn/dgamr.f,
cruft/slatec-fn/dlbeta.f, cruft/slatec-fn/dlgams.f, cruft/slatec-fn/dlngam.f,
cruft/slatec-fn/dlnrel.f, cruft/slatec-fn/dpchim.f, cruft/slatec-fn/dpchst.f,
cruft/slatec-fn/erf.f, cruft/slatec-fn/erfc.in.f, cruft/slatec-fn/gami.f,
cruft/slatec-fn/gamit.f, cruft/slatec-fn/gamlim.f, cruft/slatec-fn/gamma.f,
cruft/slatec-fn/gamr.f, cruft/slatec-fn/initds.f, cruft/slatec-fn/inits.f,
cruft/slatec-fn/module.mk, cruft/slatec-fn/pchim.f, cruft/slatec-fn/pchst.f,
cruft/slatec-fn/r9gmit.f, cruft/slatec-fn/r9lgic.f, cruft/slatec-fn/r9lgit.f,
cruft/slatec-fn/r9lgmc.f, cruft/slatec-fn/xacosh.f, cruft/slatec-fn/xasinh.f,
cruft/slatec-fn/xatanh.f, cruft/slatec-fn/xbetai.f, cruft/slatec-fn/xdacosh.f,
cruft/slatec-fn/xdasinh.f, cruft/slatec-fn/xdatanh.f,
cruft/slatec-fn/xdbetai.f, cruft/slatec-fn/xderf.f, cruft/slatec-fn/xderfc.f,
cruft/slatec-fn/xdgami.f, cruft/slatec-fn/xdgamit.f, cruft/slatec-fn/xdgamma.f,
cruft/slatec-fn/xerf.f, cruft/slatec-fn/xerfc.f, cruft/slatec-fn/xgamma.f,
cruft/slatec-fn/xgmainc.f, cruft/slatec-fn/xsgmainc.f:
Moved from top-level libcruft to cruft directory below liboctave.
* numeric/CmplxAEPBAL.cc, numeric/CmplxAEPBAL.h, numeric/CmplxCHOL.cc,
numeric/CmplxCHOL.h, numeric/CmplxGEPBAL.cc, numeric/CmplxGEPBAL.h,
numeric/CmplxHESS.cc, numeric/CmplxHESS.h, numeric/CmplxLU.cc,
numeric/CmplxLU.h, numeric/CmplxQR.cc, numeric/CmplxQR.h, numeric/CmplxQRP.cc,
numeric/CmplxQRP.h, numeric/CmplxSCHUR.cc, numeric/CmplxSCHUR.h,
numeric/CmplxSVD.cc, numeric/CmplxSVD.h, numeric/CollocWt.cc,
numeric/CollocWt.h, numeric/DAE.h, numeric/DAEFunc.h, numeric/DAERT.h,
numeric/DAERTFunc.h, numeric/DASPK-opts.in, numeric/DASPK.cc, numeric/DASPK.h,
numeric/DASRT-opts.in, numeric/DASRT.cc, numeric/DASRT.h,
numeric/DASSL-opts.in, numeric/DASSL.cc, numeric/DASSL.h, numeric/DET.h,
numeric/EIG.cc, numeric/EIG.h, numeric/LSODE-opts.in, numeric/LSODE.cc,
numeric/LSODE.h, numeric/ODE.h, numeric/ODEFunc.h, numeric/ODES.cc,
numeric/ODES.h, numeric/ODESFunc.h, numeric/Quad-opts.in, numeric/Quad.cc,
numeric/Quad.h, numeric/SparseCmplxCHOL.cc, numeric/SparseCmplxCHOL.h,
numeric/SparseCmplxLU.cc, numeric/SparseCmplxLU.h, numeric/SparseCmplxQR.cc,
numeric/SparseCmplxQR.h, numeric/SparseQR.cc, numeric/SparseQR.h,
numeric/SparsedbleCHOL.cc, numeric/SparsedbleCHOL.h, numeric/SparsedbleLU.cc,
numeric/SparsedbleLU.h, numeric/base-aepbal.h, numeric/base-dae.h,
numeric/base-de.h, numeric/base-lu.cc, numeric/base-lu.h, numeric/base-min.h,
numeric/base-qr.cc, numeric/base-qr.h, numeric/bsxfun-decl.h,
numeric/bsxfun-defs.cc, numeric/bsxfun.h, numeric/dbleAEPBAL.cc,
numeric/dbleAEPBAL.h, numeric/dbleCHOL.cc, numeric/dbleCHOL.h,
numeric/dbleGEPBAL.cc, numeric/dbleGEPBAL.h, numeric/dbleHESS.cc,
numeric/dbleHESS.h, numeric/dbleLU.cc, numeric/dbleLU.h, numeric/dbleQR.cc,
numeric/dbleQR.h, numeric/dbleQRP.cc, numeric/dbleQRP.h, numeric/dbleSCHUR.cc,
numeric/dbleSCHUR.h, numeric/dbleSVD.cc, numeric/dbleSVD.h,
numeric/eigs-base.cc, numeric/fCmplxAEPBAL.cc, numeric/fCmplxAEPBAL.h,
numeric/fCmplxCHOL.cc, numeric/fCmplxCHOL.h, numeric/fCmplxGEPBAL.cc,
numeric/fCmplxGEPBAL.h, numeric/fCmplxHESS.cc, numeric/fCmplxHESS.h,
numeric/fCmplxLU.cc, numeric/fCmplxLU.h, numeric/fCmplxQR.cc,
numeric/fCmplxQR.h, numeric/fCmplxQRP.cc, numeric/fCmplxQRP.h,
numeric/fCmplxSCHUR.cc, numeric/fCmplxSCHUR.h, numeric/fCmplxSVD.cc,
numeric/fCmplxSVD.h, numeric/fEIG.cc, numeric/fEIG.h, numeric/floatAEPBAL.cc,
numeric/floatAEPBAL.h, numeric/floatCHOL.cc, numeric/floatCHOL.h,
numeric/floatGEPBAL.cc, numeric/floatGEPBAL.h, numeric/floatHESS.cc,
numeric/floatHESS.h, numeric/floatLU.cc, numeric/floatLU.h, numeric/floatQR.cc,
numeric/floatQR.h, numeric/floatQRP.cc, numeric/floatQRP.h,
numeric/floatSCHUR.cc, numeric/floatSCHUR.h, numeric/floatSVD.cc,
numeric/floatSVD.h, numeric/lo-mappers.cc, numeric/lo-mappers.h,
numeric/lo-specfun.cc, numeric/lo-specfun.h, numeric/module.mk,
numeric/oct-convn.cc, numeric/oct-convn.h, numeric/oct-fftw.cc,
numeric/oct-fftw.h, numeric/oct-norm.cc, numeric/oct-norm.h,
numeric/oct-rand.cc, numeric/oct-rand.h, numeric/oct-spparms.cc,
numeric/oct-spparms.h, numeric/randgamma.c, numeric/randgamma.h,
numeric/randmtzig.c, numeric/randmtzig.h, numeric/randpoisson.c,
numeric/randpoisson.h, numeric/sparse-base-chol.cc, numeric/sparse-base-chol.h,
numeric/sparse-base-lu.cc, numeric/sparse-base-lu.h, numeric/sparse-dmsolve.cc:
Moved from liboctave dir to numeric subdirectory.
* operators/Sparse-diag-op-defs.h, operators/Sparse-op-defs.h,
operators/Sparse-perm-op-defs.h, operators/config-ops.sh, operators/mk-ops.awk,
operators/module.mk, operators/mx-base.h, operators/mx-defs.h,
operators/mx-ext.h, operators/mx-inlines.cc, operators/mx-op-decl.h,
operators/mx-op-defs.h, operators/mx-ops, operators/sparse-mk-ops.awk,
operators/sparse-mx-ops, operators/vx-ops:
Moved from liboctave dir to operators subdirectory.
* system/dir-ops.cc, system/dir-ops.h, system/file-ops.cc, system/file-ops.h,
system/file-stat.cc, system/file-stat.h, system/lo-sysdep.cc,
system/lo-sysdep.h, system/mach-info.cc, system/mach-info.h, system/module.mk,
system/oct-env.cc, system/oct-env.h, system/oct-group.cc, system/oct-group.h,
system/oct-openmp.h, system/oct-passwd.cc, system/oct-passwd.h,
system/oct-syscalls.cc, system/oct-syscalls.h, system/oct-time.cc,
system/oct-time.h, system/oct-uname.cc, system/oct-uname.h, system/pathlen.h,
system/sysdir.h, system/syswait.h, system/tempnam.c, system/tempname.c:
Moved from liboctave dir to system subdirectory.
* util/base-list.h, util/byte-swap.h, util/caseless-str.h, util/cmd-edit.cc,
util/cmd-edit.h, util/cmd-hist.cc, util/cmd-hist.h, util/data-conv.cc,
util/data-conv.h, util/f2c-main.c, util/functor.h, util/glob-match.cc,
util/glob-match.h, util/kpse.cc, util/lo-array-gripes.cc,
util/lo-array-gripes.h, util/lo-cieee.c, util/lo-cutils.c, util/lo-cutils.h,
util/lo-ieee.cc, util/lo-ieee.h, util/lo-macros.h, util/lo-math.h,
util/lo-traits.h, util/lo-utils.cc, util/lo-utils.h, util/module.mk,
util/oct-alloc.cc, util/oct-alloc.h, util/oct-base64.cc, util/oct-base64.h,
util/oct-binmap.h, util/oct-cmplx.h, util/oct-glob.cc, util/oct-glob.h,
util/oct-inttypes.cc, util/oct-inttypes.h, util/oct-locbuf.cc,
util/oct-locbuf.h, util/oct-md5.cc, util/oct-md5.h, util/oct-mem.h,
util/oct-mutex.cc, util/oct-mutex.h, util/oct-refcount.h, util/oct-rl-edit.c,
util/oct-rl-edit.h, util/oct-rl-hist.c, util/oct-rl-hist.h, util/oct-shlib.cc,
util/oct-shlib.h, util/oct-sort.cc, util/oct-sort.h, util/oct-sparse.h,
util/pathsearch.cc, util/pathsearch.h, util/regexp.cc, util/regexp.h,
util/singleton-cleanup.cc, util/singleton-cleanup.h, util/sparse-sort.cc,
util/sparse-sort.h, util/sparse-util.cc, util/sparse-util.h, util/statdefs.h,
util/str-vec.cc, util/str-vec.h, util/sun-utils.h:
Moved from liboctave dir to util subdirectory.
* Makefile.am: Eliminate reference to top-level liboctave directory.
* autogen.sh: cd to new liboctave/operators directory to run config-ops.sh.
* build-aux/common.mk: Eliminate LIBCRUFT references.
* configure.ac: Eliminate libcruft top-level references. Switch test
programs to find files in liboctave/cruft subdirectory.
* OctaveFAQ.texi, install.txi, mkoctfile.1: Eliminate references to libcruft in
docs.
* libgui/src/Makefile.am, libinterp/Makefile.am, src/Makefile.am: Update
include file locations. Stop linking against libcruft.
* libinterp/corefcn/module.mk: Update location of OPT_INC files which are
now in numeric/ subdirectory.
* libinterp/dldfcn/config-module.awk: Stop linking against libcruft.
* libinterp/interpfcn/toplev.cc: Remove reference to LIBCRUFT.
* libinterp/link-deps.mk, liboctave/link-deps.mk:
Add GNULIB_LINK_DEPS to link dependencies.
* libinterp/oct-conf.in.h: Remove reference to OCTAVE_CONF_LIBCRUFT.
* liboctave/Makefile.am: Overhaul to use convenience libraries in
subdirectories.
* scripts/miscellaneous/mkoctfile.m: Eliminate reference to LIBCRUFT.
* src/mkoctfile.in.cc, src/mkoctfile.in.sh: Stop linking againt libcruft.
Eliminate references to LIBCRUFT.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 31 Aug 2012 20:00:20 -0700 |
parents | liboctave/idx-vector.cc@560317fd5977 |
children | 8fce0ed4894a |
comparison
equal
deleted
inserted
replaced
15270:6615a46d90ec | 15271:648dabbb4c6b |
---|---|
1 /* | |
2 | |
3 Copyright (C) 1993-2012 John W. Eaton | |
4 Copyright (C) 2008-2009 Jaroslav Hajek | |
5 Copyright (C) 2009-2010 VZLU Prague | |
6 | |
7 This file is part of Octave. | |
8 | |
9 Octave is free software; you can redistribute it and/or modify it | |
10 under the terms of the GNU General Public License as published by the | |
11 Free Software Foundation; either version 3 of the License, or (at your | |
12 option) any later version. | |
13 | |
14 Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
20 along with Octave; see the file COPYING. If not, see | |
21 <http://www.gnu.org/licenses/>. | |
22 | |
23 */ | |
24 | |
25 #ifdef HAVE_CONFIG_H | |
26 #include <config.h> | |
27 #endif | |
28 | |
29 #include <cstdlib> | |
30 | |
31 #include <iostream> | |
32 | |
33 #include "idx-vector.h" | |
34 #include "Array.h" | |
35 #include "Array-util.h" | |
36 #include "Sparse.h" | |
37 #include "Range.h" | |
38 | |
39 #include "oct-locbuf.h" | |
40 #include "lo-error.h" | |
41 #include "lo-mappers.h" | |
42 | |
43 static void | |
44 gripe_invalid_range (void) | |
45 { | |
46 (*current_liboctave_error_handler) | |
47 ("invalid range used as index"); | |
48 } | |
49 | |
50 static void | |
51 gripe_index_out_of_range (void) | |
52 { | |
53 (*current_liboctave_error_handler) | |
54 ("internal error: idx_vector index out of range"); | |
55 } | |
56 | |
57 Array<octave_idx_type> | |
58 idx_vector::idx_base_rep::as_array (void) | |
59 { | |
60 (*current_liboctave_error_handler) | |
61 ("internal error: as_array not allowed for this index class"); | |
62 | |
63 return Array<octave_idx_type> (); | |
64 } | |
65 | |
66 DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_colon_rep); | |
67 | |
68 idx_vector::idx_colon_rep::idx_colon_rep (char c) | |
69 { | |
70 if (c != ':') | |
71 { | |
72 (*current_liboctave_error_handler) | |
73 ("internal error: invalid character converted to idx_vector; must be ':'"); | |
74 err = true; | |
75 } | |
76 } | |
77 | |
78 octave_idx_type | |
79 idx_vector::idx_colon_rep::checkelem (octave_idx_type i) const | |
80 { | |
81 if (i < 0) | |
82 { | |
83 gripe_index_out_of_range (); | |
84 return 0; | |
85 } | |
86 else | |
87 return i; | |
88 } | |
89 | |
90 idx_vector::idx_base_rep * | |
91 idx_vector::idx_colon_rep::sort_idx (Array<octave_idx_type>&) | |
92 { | |
93 (*current_liboctave_error_handler) | |
94 ("internal error: idx_colon_rep::sort_idx"); | |
95 | |
96 count++; | |
97 return this; | |
98 } | |
99 | |
100 std::ostream& | |
101 idx_vector::idx_colon_rep::print (std::ostream& os) const | |
102 { | |
103 return os << ":"; | |
104 } | |
105 | |
106 DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_range_rep); | |
107 | |
108 idx_vector::idx_range_rep::idx_range_rep (octave_idx_type _start, | |
109 octave_idx_type _limit, | |
110 octave_idx_type _step) | |
111 : start(_start), len (_step ? std::max ((_limit - _start) / _step, static_cast<octave_idx_type> (0)) : -1), step (_step) | |
112 { | |
113 if (len < 0) | |
114 { | |
115 gripe_invalid_range (); | |
116 err = true; | |
117 } | |
118 else if (start < 0 || (step < 0 && start + (len-1)*step < 0)) | |
119 { | |
120 gripe_invalid_index (); | |
121 err = true; | |
122 } | |
123 } | |
124 | |
125 idx_vector::idx_range_rep::idx_range_rep (const Range& r) | |
126 : start (0), len (r.nelem ()), step (1) | |
127 { | |
128 if (len < 0) | |
129 { | |
130 gripe_invalid_range (); | |
131 err = true; | |
132 } | |
133 else if (len > 0) | |
134 { | |
135 if (r.all_elements_are_ints ()) | |
136 { | |
137 start = static_cast<octave_idx_type> (r.base ()) - 1; | |
138 step = static_cast<octave_idx_type> (r.inc ()); | |
139 if (start < 0 || (step < 0 && start + (len-1)*step < 0)) | |
140 { | |
141 gripe_invalid_index (); | |
142 err = true; | |
143 } | |
144 } | |
145 else | |
146 { | |
147 gripe_invalid_index (); | |
148 err = true; | |
149 } | |
150 } | |
151 } | |
152 | |
153 octave_idx_type | |
154 idx_vector::idx_range_rep::checkelem (octave_idx_type i) const | |
155 { | |
156 if (i < 0 || i >= len) | |
157 { | |
158 gripe_index_out_of_range (); | |
159 return 0; | |
160 } | |
161 else | |
162 return start + i*step; | |
163 } | |
164 | |
165 idx_vector::idx_base_rep * | |
166 idx_vector::idx_range_rep::sort_uniq_clone (bool) | |
167 { | |
168 if (step < 0) | |
169 return new idx_range_rep (start + (len - 1)*step, len, -step, DIRECT); | |
170 else | |
171 { | |
172 count++; | |
173 return this; | |
174 } | |
175 } | |
176 | |
177 idx_vector::idx_base_rep * | |
178 idx_vector::idx_range_rep::sort_idx (Array<octave_idx_type>& idx) | |
179 { | |
180 if (step < 0 && len > 0) | |
181 { | |
182 idx.clear (1, len); | |
183 for (octave_idx_type i = 0; i < len; i++) | |
184 idx.xelem (i) = len - 1 - i; | |
185 return new idx_range_rep (start + (len - 1)*step, len, -step, DIRECT); | |
186 } | |
187 else | |
188 { | |
189 idx.clear (1, len); | |
190 for (octave_idx_type i = 0; i < len; i++) | |
191 idx.xelem (i) = i; | |
192 count++; | |
193 return this; | |
194 } | |
195 } | |
196 | |
197 std::ostream& | |
198 idx_vector::idx_range_rep::print (std::ostream& os) const | |
199 { | |
200 os << start << ':' << step << ':' << start + len*step; | |
201 return os; | |
202 } | |
203 | |
204 Range | |
205 idx_vector::idx_range_rep::unconvert (void) const | |
206 { | |
207 return Range (static_cast<double> (start+1), | |
208 static_cast<double> (step), len); | |
209 } | |
210 | |
211 Array<octave_idx_type> | |
212 idx_vector::idx_range_rep::as_array (void) | |
213 { | |
214 Array<octave_idx_type> retval (dim_vector (1, len)); | |
215 for (octave_idx_type i = 0; i < len; i++) | |
216 retval.xelem (i) = start + i*step; | |
217 | |
218 return retval; | |
219 } | |
220 | |
221 inline octave_idx_type | |
222 convert_index (octave_idx_type i, bool& conv_error, | |
223 octave_idx_type& ext) | |
224 { | |
225 if (i <= 0) | |
226 conv_error = true; | |
227 | |
228 if (ext < i) | |
229 ext = i; | |
230 | |
231 return i - 1; | |
232 } | |
233 | |
234 inline octave_idx_type | |
235 convert_index (double x, bool& conv_error, octave_idx_type& ext) | |
236 { | |
237 octave_idx_type i = static_cast<octave_idx_type> (x); | |
238 | |
239 if (static_cast<double> (i) != x) | |
240 conv_error = true; | |
241 | |
242 return convert_index (i, conv_error, ext); | |
243 } | |
244 | |
245 inline octave_idx_type | |
246 convert_index (float x, bool& conv_error, octave_idx_type& ext) | |
247 { | |
248 return convert_index (static_cast<double> (x), conv_error, ext); | |
249 } | |
250 | |
251 template <class T> | |
252 inline octave_idx_type | |
253 convert_index (octave_int<T> x, bool& conv_error, | |
254 octave_idx_type& ext) | |
255 { | |
256 octave_idx_type i = octave_int<octave_idx_type> (x).value (); | |
257 | |
258 return convert_index (i, conv_error, ext); | |
259 } | |
260 | |
261 DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_scalar_rep); | |
262 | |
263 template <class T> | |
264 idx_vector::idx_scalar_rep::idx_scalar_rep (T x) | |
265 : data (0) | |
266 { | |
267 octave_idx_type dummy = 0; | |
268 | |
269 data = convert_index (x, err, dummy); | |
270 | |
271 if (err) | |
272 gripe_invalid_index (); | |
273 } | |
274 | |
275 idx_vector::idx_scalar_rep::idx_scalar_rep (octave_idx_type i) | |
276 : data (i) | |
277 { | |
278 if (data < 0) | |
279 { | |
280 gripe_invalid_index (); | |
281 err = true; | |
282 } | |
283 } | |
284 | |
285 octave_idx_type | |
286 idx_vector::idx_scalar_rep::checkelem (octave_idx_type i) const | |
287 { | |
288 if (i != 0) | |
289 gripe_index_out_of_range (); | |
290 | |
291 return data; | |
292 } | |
293 | |
294 idx_vector::idx_base_rep * | |
295 idx_vector::idx_scalar_rep::sort_idx (Array<octave_idx_type>& idx) | |
296 { | |
297 idx.clear (1, 1); | |
298 idx.fill (0); | |
299 count++; | |
300 return this; | |
301 } | |
302 | |
303 std::ostream& idx_vector::idx_scalar_rep::print (std::ostream& os) const | |
304 { | |
305 return os << data; | |
306 } | |
307 | |
308 double | |
309 idx_vector::idx_scalar_rep::unconvert (void) const | |
310 { | |
311 return data + 1; | |
312 } | |
313 | |
314 Array<octave_idx_type> | |
315 idx_vector::idx_scalar_rep::as_array (void) | |
316 { | |
317 return Array<octave_idx_type> (dim_vector (1, 1), data); | |
318 } | |
319 | |
320 DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_vector_rep); | |
321 | |
322 template <class T> | |
323 idx_vector::idx_vector_rep::idx_vector_rep (const Array<T>& nda) | |
324 : data (0), len (nda.numel ()), ext (0), aowner (0), orig_dims (nda.dims ()) | |
325 { | |
326 if (len != 0) | |
327 { | |
328 octave_idx_type *d = new octave_idx_type [len]; | |
329 for (octave_idx_type i = 0; i < len; i++) | |
330 d[i] = convert_index (nda.xelem (i), err, ext); | |
331 data = d; | |
332 | |
333 if (err) | |
334 { | |
335 delete [] data; | |
336 gripe_invalid_index (); | |
337 } | |
338 } | |
339 } | |
340 | |
341 // Note that this makes a shallow copy of the index array. | |
342 | |
343 idx_vector::idx_vector_rep::idx_vector_rep (const Array<octave_idx_type>& inda) | |
344 : data (inda.data ()), len (inda.numel ()), ext (0), | |
345 aowner (new Array<octave_idx_type> (inda)), orig_dims (inda.dims ()) | |
346 { | |
347 if (len != 0) | |
348 { | |
349 octave_idx_type max = -1; | |
350 for (octave_idx_type i = 0; i < len; i++) | |
351 { | |
352 octave_idx_type k = inda.xelem (i); | |
353 if (k < 0) | |
354 err = true; | |
355 else if (k > max) | |
356 max = k; | |
357 } | |
358 | |
359 ext = max + 1; | |
360 | |
361 if (err) | |
362 gripe_invalid_index (); | |
363 } | |
364 } | |
365 | |
366 idx_vector::idx_vector_rep::idx_vector_rep (const Array<octave_idx_type>& inda, | |
367 octave_idx_type _ext, direct) | |
368 : data (inda.data ()), len (inda.numel ()), ext (_ext), | |
369 aowner (new Array<octave_idx_type> (inda)), orig_dims (inda.dims ()) | |
370 { | |
371 // No checking. | |
372 if (ext < 0) | |
373 { | |
374 octave_idx_type max = -1; | |
375 for (octave_idx_type i = 0; i < len; i++) | |
376 if (data[i] > max) | |
377 max = data[i]; | |
378 | |
379 ext = max + 1; | |
380 } | |
381 } | |
382 | |
383 idx_vector::idx_vector_rep::idx_vector_rep (bool b) | |
384 : data (0), len (b ? 1 : 0), ext (0), aowner (0), orig_dims (len, len) | |
385 { | |
386 if (len != 0) | |
387 { | |
388 octave_idx_type *d = new octave_idx_type [1]; | |
389 d[0] = 0; | |
390 data = d; | |
391 ext = 1; | |
392 } | |
393 } | |
394 | |
395 idx_vector::idx_vector_rep::idx_vector_rep (const Array<bool>& bnda, | |
396 octave_idx_type nnz) | |
397 : data (0), len (nnz), ext (0), aowner (0), orig_dims () | |
398 { | |
399 if (nnz < 0) | |
400 len = bnda.nnz (); | |
401 | |
402 const dim_vector dv = bnda.dims (); | |
403 | |
404 if (! dv.all_zero ()) | |
405 orig_dims = ((dv.length () == 2 && dv(0) == 1) | |
406 ? dim_vector (1, len) : dim_vector (len, 1)); | |
407 | |
408 if (len != 0) | |
409 { | |
410 octave_idx_type *d = new octave_idx_type [len]; | |
411 | |
412 octave_idx_type ntot = bnda.length (); | |
413 | |
414 octave_idx_type k = 0; | |
415 for (octave_idx_type i = 0; i < ntot; i++) | |
416 if (bnda.xelem (i)) | |
417 d[k++] = i; | |
418 | |
419 data = d; | |
420 | |
421 ext = d[k-1] + 1; | |
422 } | |
423 } | |
424 | |
425 idx_vector::idx_vector_rep::idx_vector_rep (const Sparse<bool>& bnda) | |
426 : data (0), len (0), ext (0), aowner (0), orig_dims () | |
427 { | |
428 for (octave_idx_type i = 0, l = bnda.nnz (); i < l; i++) | |
429 if (bnda.data (i)) len++; | |
430 | |
431 dim_vector dv = bnda.dims (); | |
432 | |
433 orig_dims = ((dv.length () == 2 && dv(0) == 1) | |
434 ? dim_vector (1, len) : orig_dims = dim_vector (len, 1)); | |
435 | |
436 if (len != 0) | |
437 { | |
438 octave_idx_type *d = new octave_idx_type [len]; | |
439 | |
440 octave_idx_type nnz = bnda.nnz (); | |
441 | |
442 octave_idx_type k = 0; | |
443 // FIXME: I hope this is OK, i.e. the element iterated this way are correctly ordered. | |
444 for (octave_idx_type i = 0; i < nnz; i++) | |
445 { | |
446 if (bnda.data (i)) | |
447 d[k++] = bnda.cidx (i) + bnda.rows () * bnda.ridx (i); | |
448 } | |
449 | |
450 data = d; | |
451 | |
452 ext = d[k-1] + 1; | |
453 } | |
454 } | |
455 | |
456 idx_vector::idx_vector_rep::~idx_vector_rep (void) | |
457 { | |
458 if (aowner) | |
459 delete aowner; | |
460 else | |
461 delete [] data; | |
462 } | |
463 | |
464 octave_idx_type | |
465 idx_vector::idx_vector_rep::checkelem (octave_idx_type n) const | |
466 { | |
467 if (n < 0 || n >= len) | |
468 { | |
469 gripe_invalid_index (); | |
470 return 0; | |
471 } | |
472 | |
473 return xelem (n); | |
474 } | |
475 | |
476 idx_vector::idx_base_rep * | |
477 idx_vector::idx_vector_rep::sort_uniq_clone (bool uniq) | |
478 { | |
479 if (len == 0) | |
480 { | |
481 count++; | |
482 return this; | |
483 } | |
484 | |
485 // This is wrapped in auto_ptr so that we don't leak on out-of-memory. | |
486 std::auto_ptr<idx_vector_rep> new_rep ( | |
487 new idx_vector_rep (0, len, ext, orig_dims, DIRECT)); | |
488 | |
489 if (ext > len*xlog2 (1.0 + len)) | |
490 { | |
491 // Use standard sort via octave_sort. | |
492 octave_idx_type *new_data = new octave_idx_type [len]; | |
493 new_rep->data = new_data; | |
494 | |
495 std::copy (data, data + len, new_data); | |
496 octave_sort<octave_idx_type> lsort; | |
497 lsort.set_compare (ASCENDING); | |
498 lsort.sort (new_data, len); | |
499 | |
500 if (uniq) | |
501 { | |
502 octave_idx_type new_len = std::unique (new_data, new_data + len) - new_data; | |
503 new_rep->len = new_len; | |
504 if (new_rep->orig_dims.length () == 2 && new_rep->orig_dims(0) == 1) | |
505 new_rep->orig_dims = dim_vector (1, new_len); | |
506 else | |
507 new_rep->orig_dims = dim_vector (new_len, 1); | |
508 } | |
509 } | |
510 else if (uniq) | |
511 { | |
512 // Use two-pass bucket sort (only a mask array needed). | |
513 OCTAVE_LOCAL_BUFFER_INIT (bool, has, ext, false); | |
514 for (octave_idx_type i = 0; i < len; i++) | |
515 has[data[i]] = true; | |
516 | |
517 octave_idx_type new_len = 0; | |
518 for (octave_idx_type i = 0; i < ext; i++) | |
519 new_len += has[i]; | |
520 | |
521 new_rep->len = new_len; | |
522 if (new_rep->orig_dims.length () == 2 && new_rep->orig_dims(0) == 1) | |
523 new_rep->orig_dims = dim_vector (1, new_len); | |
524 else | |
525 new_rep->orig_dims = dim_vector (new_len, 1); | |
526 | |
527 octave_idx_type *new_data = new octave_idx_type [new_len]; | |
528 new_rep->data = new_data; | |
529 | |
530 for (octave_idx_type i = 0, j = 0; i < ext; i++) | |
531 if (has[i]) | |
532 new_data[j++] = i; | |
533 } | |
534 else | |
535 { | |
536 // Use two-pass bucket sort. | |
537 OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, cnt, ext, 0); | |
538 for (octave_idx_type i = 0; i < len; i++) | |
539 cnt[data[i]]++; | |
540 | |
541 octave_idx_type *new_data = new octave_idx_type [len]; | |
542 new_rep->data = new_data; | |
543 | |
544 for (octave_idx_type i = 0, j = 0; i < ext; i++) | |
545 { | |
546 for (octave_idx_type k = 0; k < cnt[i]; k++) | |
547 new_data[j++] = i; | |
548 } | |
549 } | |
550 | |
551 return new_rep.release (); | |
552 } | |
553 | |
554 idx_vector::idx_base_rep * | |
555 idx_vector::idx_vector_rep::sort_idx (Array<octave_idx_type>& idx) | |
556 { | |
557 // This is wrapped in auto_ptr so that we don't leak on out-of-memory. | |
558 std::auto_ptr<idx_vector_rep> new_rep ( | |
559 new idx_vector_rep (0, len, ext, orig_dims, DIRECT)); | |
560 | |
561 if (ext > len*xlog2 (1.0 + len)) | |
562 { | |
563 // Use standard sort via octave_sort. | |
564 idx.clear (orig_dims); | |
565 octave_idx_type *idx_data = idx.fortran_vec (); | |
566 for (octave_idx_type i = 0; i < len; i++) | |
567 idx_data[i] = i; | |
568 | |
569 octave_idx_type *new_data = new octave_idx_type [len]; | |
570 new_rep->data = new_data; | |
571 std::copy (data, data + len, new_data); | |
572 | |
573 octave_sort<octave_idx_type> lsort; | |
574 lsort.set_compare (ASCENDING); | |
575 lsort.sort (new_data, idx_data, len); | |
576 } | |
577 else | |
578 { | |
579 // Use two-pass bucket sort. | |
580 OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, cnt, ext, 0); | |
581 | |
582 for (octave_idx_type i = 0; i < len; i++) | |
583 cnt[data[i]]++; | |
584 | |
585 idx.clear (orig_dims); | |
586 octave_idx_type *idx_data = idx.fortran_vec (); | |
587 | |
588 octave_idx_type *new_data = new octave_idx_type [len]; | |
589 new_rep->data = new_data; | |
590 | |
591 for (octave_idx_type i = 0, k = 0; i < ext; i++) | |
592 { | |
593 octave_idx_type j = cnt[i]; | |
594 cnt[i] = k; | |
595 k += j; | |
596 } | |
597 | |
598 for (octave_idx_type i = 0; i < len; i++) | |
599 { | |
600 octave_idx_type j = data[i], k = cnt[j]++; | |
601 new_data[k] = j; | |
602 idx_data[k] = i; | |
603 } | |
604 } | |
605 | |
606 return new_rep.release (); | |
607 } | |
608 | |
609 std::ostream& | |
610 idx_vector::idx_vector_rep::print (std::ostream& os) const | |
611 { | |
612 os << '['; | |
613 | |
614 for (octave_idx_type ii = 0; ii < len - 1; ii++) | |
615 os << data[ii] << ',' << ' '; | |
616 | |
617 if (len > 0) | |
618 os << data[len-1]; os << ']'; | |
619 | |
620 return os; | |
621 } | |
622 | |
623 Array<double> | |
624 idx_vector::idx_vector_rep::unconvert (void) const | |
625 { | |
626 Array<double> retval (orig_dims); | |
627 for (octave_idx_type i = 0; i < len; i++) | |
628 retval.xelem (i) = data[i] + 1; | |
629 return retval; | |
630 } | |
631 | |
632 Array<octave_idx_type> | |
633 idx_vector::idx_vector_rep::as_array (void) | |
634 { | |
635 if (aowner) | |
636 return *aowner; | |
637 else | |
638 { | |
639 Array<octave_idx_type> retval (orig_dims); | |
640 std::memcpy (retval.fortran_vec (), data, len*sizeof (octave_idx_type)); | |
641 // Delete the old copy and share the data instead to save memory. | |
642 delete [] data; | |
643 data = retval.fortran_vec (); | |
644 aowner = new Array<octave_idx_type> (retval); | |
645 return retval; | |
646 } | |
647 } | |
648 | |
649 DEFINE_OCTAVE_ALLOCATOR(idx_vector::idx_mask_rep); | |
650 | |
651 idx_vector::idx_mask_rep::idx_mask_rep (bool b) | |
652 : data (0), len (b ? 1 : 0), ext (0), lsti (-1), lste (-1), | |
653 aowner (0), orig_dims (len, len) | |
654 { | |
655 if (len != 0) | |
656 { | |
657 bool *d = new bool [1]; | |
658 d[0] = true; | |
659 data = d; | |
660 ext = 1; | |
661 } | |
662 } | |
663 | |
664 idx_vector::idx_mask_rep::idx_mask_rep (const Array<bool>& bnda, | |
665 octave_idx_type nnz) | |
666 : data (0), len (nnz), ext (bnda.numel ()), lsti (-1), lste (-1), | |
667 aowner (0), orig_dims () | |
668 { | |
669 if (nnz < 0) | |
670 len = bnda.nnz (); | |
671 | |
672 // We truncate the extent as much as possible. For Matlab | |
673 // compatibility, but maybe it's not a bad idea anyway. | |
674 while (ext > 0 && ! bnda(ext-1)) | |
675 ext--; | |
676 | |
677 const dim_vector dv = bnda.dims (); | |
678 | |
679 if (! dv.all_zero ()) | |
680 orig_dims = ((dv.length () == 2 && dv(0) == 1) | |
681 ? dim_vector (1, len) : dim_vector (len, 1)); | |
682 | |
683 aowner = new Array<bool> (bnda); | |
684 data = bnda.data (); | |
685 } | |
686 | |
687 idx_vector::idx_mask_rep::~idx_mask_rep (void) | |
688 { | |
689 if (aowner) | |
690 delete aowner; | |
691 else | |
692 delete [] data; | |
693 } | |
694 | |
695 octave_idx_type | |
696 idx_vector::idx_mask_rep::xelem (octave_idx_type n) const | |
697 { | |
698 if (n == lsti + 1) | |
699 { | |
700 lsti = n; | |
701 while (! data[++lste]) ; | |
702 } | |
703 else | |
704 { | |
705 lsti = n++; | |
706 lste = -1; | |
707 while (n > 0) | |
708 if (data[++lste]) --n; | |
709 } | |
710 return lste; | |
711 } | |
712 | |
713 octave_idx_type | |
714 idx_vector::idx_mask_rep::checkelem (octave_idx_type n) const | |
715 { | |
716 if (n < 0 || n >= len) | |
717 { | |
718 gripe_invalid_index (); | |
719 return 0; | |
720 } | |
721 | |
722 return xelem (n); | |
723 } | |
724 | |
725 std::ostream& | |
726 idx_vector::idx_mask_rep::print (std::ostream& os) const | |
727 { | |
728 os << '['; | |
729 | |
730 for (octave_idx_type ii = 0; ii < ext - 1; ii++) | |
731 os << data[ii] << ',' << ' '; | |
732 | |
733 if (ext > 0) | |
734 os << data[ext-1]; os << ']'; | |
735 | |
736 return os; | |
737 } | |
738 | |
739 Array<bool> | |
740 idx_vector::idx_mask_rep::unconvert (void) const | |
741 { | |
742 if (aowner) | |
743 return *aowner; | |
744 else | |
745 { | |
746 Array<bool> retval (dim_vector (ext, 1)); | |
747 for (octave_idx_type i = 0; i < ext; i++) | |
748 retval.xelem (i) = data[i]; | |
749 return retval; | |
750 } | |
751 } | |
752 | |
753 Array<octave_idx_type> | |
754 idx_vector::idx_mask_rep::as_array (void) | |
755 { | |
756 if (aowner) | |
757 return aowner->find ().reshape (orig_dims); | |
758 else | |
759 { | |
760 Array<bool> retval (orig_dims); | |
761 for (octave_idx_type i = 0, j = 0; i < ext; i++) | |
762 if (data[i]) | |
763 retval.xelem (j++) = i; | |
764 | |
765 return retval; | |
766 } | |
767 } | |
768 | |
769 idx_vector::idx_base_rep * | |
770 idx_vector::idx_mask_rep::sort_idx (Array<octave_idx_type>& idx) | |
771 { | |
772 idx.clear (len, 1); | |
773 for (octave_idx_type i = 0; i < len; i++) | |
774 idx.xelem (i) = i; | |
775 | |
776 count++; | |
777 return this; | |
778 } | |
779 | |
780 const idx_vector idx_vector::colon (new idx_vector::idx_colon_rep ()); | |
781 | |
782 idx_vector::idx_vector (const Array<bool>& bnda) | |
783 : rep (0) | |
784 { | |
785 // Convert only if it means saving at least half the memory. | |
786 static const int factor = (2 * sizeof (octave_idx_type)); | |
787 octave_idx_type nnz = bnda.nnz (); | |
788 if (nnz <= bnda.numel () / factor) | |
789 rep = new idx_vector_rep (bnda, nnz); | |
790 else | |
791 rep = new idx_mask_rep (bnda, nnz); | |
792 } | |
793 | |
794 bool | |
795 idx_vector::maybe_reduce (octave_idx_type n, const idx_vector& j, | |
796 octave_idx_type nj) | |
797 { | |
798 bool reduced = false; | |
799 | |
800 // Empty index always reduces. | |
801 if (rep->length (n) == 0) | |
802 { | |
803 *this = idx_vector (); | |
804 return true; | |
805 } | |
806 | |
807 // Possibly skip singleton dims. | |
808 if (n == 1 && rep->is_colon_equiv (n)) | |
809 { | |
810 *this = j; | |
811 return true; | |
812 } | |
813 | |
814 if (nj == 1 && j.is_colon_equiv (nj)) | |
815 return true; | |
816 | |
817 switch (j.idx_class ()) | |
818 { | |
819 case class_colon: | |
820 switch (rep->idx_class ()) | |
821 { | |
822 case class_colon: | |
823 // (:,:) reduces to (:) | |
824 reduced = true; | |
825 break; | |
826 | |
827 case class_scalar: | |
828 { | |
829 // (i,:) reduces to a range. | |
830 idx_scalar_rep * r = dynamic_cast<idx_scalar_rep *> (rep); | |
831 octave_idx_type k = r->get_data (); | |
832 *this = new idx_range_rep (k, nj, n, DIRECT); | |
833 reduced = true; | |
834 } | |
835 break; | |
836 | |
837 case class_range: | |
838 { | |
839 // (i:k:end,:) reduces to a range if i <= k and k divides n. | |
840 idx_range_rep * r = dynamic_cast<idx_range_rep *> (rep); | |
841 octave_idx_type s = r->get_start (), l = r->length (n); | |
842 octave_idx_type t = r->get_step (); | |
843 if (l*t == n) | |
844 { | |
845 *this = new idx_range_rep (s, l * nj, t, DIRECT); | |
846 reduced = true; | |
847 } | |
848 } | |
849 break; | |
850 | |
851 default: | |
852 break; | |
853 } | |
854 break; | |
855 | |
856 case class_range: | |
857 switch (rep->idx_class ()) | |
858 { | |
859 case class_colon: | |
860 { | |
861 // (:,i:j) reduces to a range (the step must be 1) | |
862 idx_range_rep * rj = dynamic_cast<idx_range_rep *> (j.rep); | |
863 if (rj->get_step () == 1) | |
864 { | |
865 octave_idx_type sj = rj->get_start (), lj = rj->length (nj); | |
866 *this = new idx_range_rep (sj * n, lj * n, 1, DIRECT); | |
867 reduced = true; | |
868 } | |
869 } | |
870 break; | |
871 | |
872 case class_scalar: | |
873 { | |
874 // (k,i:d:j) reduces to a range. | |
875 idx_scalar_rep * r = dynamic_cast<idx_scalar_rep *> (rep); | |
876 idx_range_rep * rj = dynamic_cast<idx_range_rep *> (j.rep); | |
877 octave_idx_type k = r->get_data (); | |
878 octave_idx_type sj = rj->get_start (), lj = rj->length (nj); | |
879 octave_idx_type tj = rj->get_step (); | |
880 *this = new idx_range_rep (n * sj + k, lj, n * tj, DIRECT); | |
881 reduced = true; | |
882 } | |
883 break; | |
884 | |
885 case class_range: | |
886 { | |
887 // (i:k:end,p:q) reduces to a range if i <= k and k divides n. | |
888 // (ones (1, m), ones (1, n)) reduces to (ones (1, m*n)) | |
889 idx_range_rep * r = dynamic_cast<idx_range_rep *> (rep); | |
890 octave_idx_type s = r->get_start (), l = r->length (n); | |
891 octave_idx_type t = r->get_step (); | |
892 idx_range_rep * rj = dynamic_cast<idx_range_rep *> (j.rep); | |
893 octave_idx_type sj = rj->get_start (), lj = rj->length (nj); | |
894 octave_idx_type tj = rj->get_step (); | |
895 if ((l*t == n && tj == 1) || (t == 0 && tj == 0)) | |
896 { | |
897 *this = new idx_range_rep (s + n * sj, l * lj, t, DIRECT); | |
898 reduced = true; | |
899 } | |
900 } | |
901 break; | |
902 | |
903 default: | |
904 break; | |
905 } | |
906 break; | |
907 | |
908 case class_scalar: | |
909 switch (rep->idx_class ()) | |
910 { | |
911 case class_scalar: | |
912 { | |
913 // (i,j) reduces to a single index. | |
914 idx_scalar_rep * r = dynamic_cast<idx_scalar_rep *> (rep); | |
915 idx_scalar_rep * rj = dynamic_cast<idx_scalar_rep *> (j.rep); | |
916 octave_idx_type k = r->get_data () + n * rj->get_data (); | |
917 *this = new idx_scalar_rep (k, DIRECT); | |
918 reduced = true; | |
919 } | |
920 break; | |
921 | |
922 case class_range: | |
923 { | |
924 // (i:d:j,k) reduces to a range. | |
925 idx_range_rep * r = dynamic_cast<idx_range_rep *> (rep); | |
926 idx_scalar_rep * rj = dynamic_cast<idx_scalar_rep *> (j.rep); | |
927 octave_idx_type s = r->get_start (), l = r->length (nj); | |
928 octave_idx_type t = r->get_step (); | |
929 octave_idx_type k = rj->get_data (); | |
930 *this = new idx_range_rep (n * k + s, l, t, DIRECT); | |
931 reduced = true; | |
932 } | |
933 break; | |
934 | |
935 case class_colon: | |
936 { | |
937 // (:,k) reduces to a range. | |
938 idx_scalar_rep * rj = dynamic_cast<idx_scalar_rep *> (j.rep); | |
939 octave_idx_type k = rj->get_data (); | |
940 *this = new idx_range_rep (n * k, n, 1, DIRECT); | |
941 reduced = true; | |
942 } | |
943 break; | |
944 | |
945 default: | |
946 break; | |
947 } | |
948 break; | |
949 | |
950 default: | |
951 break; | |
952 } | |
953 | |
954 return reduced; | |
955 } | |
956 | |
957 bool | |
958 idx_vector::is_cont_range (octave_idx_type n, | |
959 octave_idx_type& l, octave_idx_type& u) const | |
960 { | |
961 bool res = false; | |
962 | |
963 switch (rep->idx_class ()) | |
964 { | |
965 case class_colon: | |
966 l = 0; u = n; | |
967 res = true; | |
968 break; | |
969 | |
970 case class_range: | |
971 { | |
972 idx_range_rep * r = dynamic_cast<idx_range_rep *> (rep); | |
973 if (r->get_step () == 1) | |
974 { | |
975 l = r->get_start (); | |
976 u = l + r->length (n); | |
977 res = true; | |
978 } | |
979 } | |
980 break; | |
981 | |
982 case class_scalar: | |
983 { | |
984 idx_scalar_rep * r = dynamic_cast<idx_scalar_rep *> (rep); | |
985 l = r->get_data (); | |
986 u = l + 1; | |
987 res = true; | |
988 } | |
989 break; | |
990 | |
991 case class_mask: | |
992 { | |
993 idx_mask_rep * r = dynamic_cast<idx_mask_rep *> (rep); | |
994 octave_idx_type ext = r->extent (0), len = r->length (0); | |
995 if (ext == len) | |
996 { | |
997 l = 0; | |
998 u = len; | |
999 res = true; | |
1000 } | |
1001 } | |
1002 | |
1003 default: | |
1004 break; | |
1005 } | |
1006 | |
1007 return res; | |
1008 } | |
1009 | |
1010 octave_idx_type | |
1011 idx_vector::increment (void) const | |
1012 { | |
1013 octave_idx_type retval = 0; | |
1014 | |
1015 switch (rep->idx_class ()) | |
1016 { | |
1017 case class_colon: | |
1018 retval = 1; | |
1019 break; | |
1020 | |
1021 case class_range: | |
1022 retval = dynamic_cast<idx_range_rep *> (rep) -> get_step (); | |
1023 break; | |
1024 | |
1025 case class_vector: | |
1026 case class_mask: | |
1027 { | |
1028 if (length (0) > 1) | |
1029 retval = elem (1) - elem (0); | |
1030 } | |
1031 break; | |
1032 | |
1033 default: | |
1034 break; | |
1035 } | |
1036 | |
1037 return retval; | |
1038 } | |
1039 | |
1040 const octave_idx_type * | |
1041 idx_vector::raw (void) | |
1042 { | |
1043 if (rep->idx_class () != class_vector) | |
1044 *this = idx_vector (as_array (), extent (0)); | |
1045 | |
1046 idx_vector_rep * r = dynamic_cast<idx_vector_rep *> (rep); | |
1047 | |
1048 assert (r != 0); | |
1049 | |
1050 return r->get_data (); | |
1051 } | |
1052 | |
1053 void | |
1054 idx_vector::copy_data (octave_idx_type *data) const | |
1055 { | |
1056 octave_idx_type len = rep->length (0); | |
1057 | |
1058 switch (rep->idx_class ()) | |
1059 { | |
1060 case class_colon: | |
1061 current_liboctave_error_handler ("colon not allowed"); | |
1062 break; | |
1063 | |
1064 case class_range: | |
1065 { | |
1066 idx_range_rep * r = dynamic_cast<idx_range_rep *> (rep); | |
1067 octave_idx_type start = r->get_start (), step = r->get_step (); | |
1068 octave_idx_type i, j; | |
1069 if (step == 1) | |
1070 for (i = start, j = start + len; i < j; i++) *data++ = i; | |
1071 else if (step == -1) | |
1072 for (i = start, j = start - len; i > j; i--) *data++ = i; | |
1073 else | |
1074 for (i = 0, j = start; i < len; i++, j += step) *data++ = j; | |
1075 } | |
1076 break; | |
1077 | |
1078 case class_scalar: | |
1079 { | |
1080 idx_scalar_rep * r = dynamic_cast<idx_scalar_rep *> (rep); | |
1081 *data = r->get_data (); | |
1082 } | |
1083 break; | |
1084 | |
1085 case class_vector: | |
1086 { | |
1087 idx_vector_rep * r = dynamic_cast<idx_vector_rep *> (rep); | |
1088 const octave_idx_type *rdata = r->get_data (); | |
1089 copy_or_memcpy (len, rdata, data); | |
1090 } | |
1091 break; | |
1092 | |
1093 case class_mask: | |
1094 { | |
1095 idx_mask_rep * r = dynamic_cast<idx_mask_rep *> (rep); | |
1096 const bool *mask = r->get_data (); | |
1097 octave_idx_type ext = r->extent (0); | |
1098 for (octave_idx_type i = 0, j = 0; i < ext; i++) | |
1099 if (mask[i]) | |
1100 data[j++] = i; | |
1101 } | |
1102 break; | |
1103 | |
1104 default: | |
1105 assert (false); | |
1106 break; | |
1107 } | |
1108 } | |
1109 | |
1110 idx_vector | |
1111 idx_vector::complement (octave_idx_type n) const | |
1112 { | |
1113 idx_vector retval; | |
1114 if (extent (n) > n) | |
1115 (*current_liboctave_error_handler) | |
1116 ("internal error: out of range complement index requested"); | |
1117 | |
1118 if (idx_class () == class_mask) | |
1119 { | |
1120 idx_mask_rep * r = dynamic_cast<idx_mask_rep *> (rep); | |
1121 octave_idx_type nz = r->length (0), ext = r->extent (0); | |
1122 Array<bool> mask (dim_vector (n, 1)); | |
1123 const bool *data = r->get_data (); | |
1124 bool *ndata = mask.fortran_vec (); | |
1125 for (octave_idx_type i = 0; i < ext; i++) | |
1126 ndata[i] = ! data[i]; | |
1127 for (octave_idx_type i = ext; i < n; i++) | |
1128 ndata[i] = true; | |
1129 retval = new idx_mask_rep (mask, n - nz); | |
1130 } | |
1131 else | |
1132 { | |
1133 Array<bool> mask (dim_vector (n, 1), true); | |
1134 fill (false, length (n), mask.fortran_vec ()); | |
1135 retval = idx_vector (mask); | |
1136 } | |
1137 | |
1138 return retval; | |
1139 } | |
1140 | |
1141 bool | |
1142 idx_vector::is_permutation (octave_idx_type n) const | |
1143 { | |
1144 bool retval = false; | |
1145 | |
1146 if (is_colon_equiv (n)) | |
1147 retval = true; | |
1148 else if (length(n) == n && extent(n) == n) | |
1149 { | |
1150 OCTAVE_LOCAL_BUFFER_INIT (bool, left, n, true); | |
1151 | |
1152 retval = true; | |
1153 | |
1154 for (octave_idx_type i = 0, len = length (); i < len; i++) | |
1155 { | |
1156 octave_idx_type k = xelem (i); | |
1157 if (left[k]) | |
1158 left[k] = false; | |
1159 else | |
1160 { | |
1161 retval = false; | |
1162 break; | |
1163 } | |
1164 } | |
1165 } | |
1166 | |
1167 return retval; | |
1168 } | |
1169 | |
1170 idx_vector | |
1171 idx_vector::inverse_permutation (octave_idx_type n) const | |
1172 { | |
1173 assert (n == length (n)); | |
1174 | |
1175 idx_vector retval; | |
1176 | |
1177 switch (idx_class ()) | |
1178 { | |
1179 case class_range: | |
1180 { | |
1181 if (increment () == -1) | |
1182 retval = sorted (); | |
1183 else | |
1184 retval = *this; | |
1185 break; | |
1186 } | |
1187 case class_vector: | |
1188 { | |
1189 idx_vector_rep *r = dynamic_cast<idx_vector_rep *> (rep); | |
1190 const octave_idx_type *ri = r->get_data (); | |
1191 Array<octave_idx_type> idx (orig_dimensions ()); | |
1192 for (octave_idx_type i = 0; i < n; i++) | |
1193 idx.xelem (ri[i]) = i; | |
1194 retval = new idx_vector_rep (idx, r->extent (0), DIRECT); | |
1195 break; | |
1196 } | |
1197 default: | |
1198 retval = *this; | |
1199 break; | |
1200 } | |
1201 | |
1202 return retval; | |
1203 } | |
1204 | |
1205 idx_vector | |
1206 idx_vector::unmask (void) const | |
1207 { | |
1208 if (idx_class () == class_mask) | |
1209 { | |
1210 idx_mask_rep * r = dynamic_cast<idx_mask_rep *> (rep); | |
1211 const bool *data = r->get_data (); | |
1212 octave_idx_type ext = r->extent (0), len = r->length (0); | |
1213 octave_idx_type *idata = new octave_idx_type [len]; | |
1214 | |
1215 for (octave_idx_type i = 0, j = 0; i < ext; i++) | |
1216 if (data[i]) | |
1217 idata[j++] = i; | |
1218 | |
1219 ext = len > 0 ? idata[len - 1] + 1 : 0; | |
1220 | |
1221 return new idx_vector_rep (idata, len, ext, r->orig_dimensions (), | |
1222 DIRECT); | |
1223 } | |
1224 else | |
1225 return *this; | |
1226 } | |
1227 | |
1228 void idx_vector::unconvert (idx_class_type& iclass, | |
1229 double& scalar, Range& range, | |
1230 Array<double>& array, Array<bool>& mask) const | |
1231 { | |
1232 iclass = idx_class (); | |
1233 switch (iclass) | |
1234 { | |
1235 case class_colon: | |
1236 break; | |
1237 | |
1238 case class_range: | |
1239 { | |
1240 idx_range_rep *r = dynamic_cast<idx_range_rep *> (rep); | |
1241 range = r->unconvert (); | |
1242 } | |
1243 break; | |
1244 | |
1245 case class_scalar: | |
1246 { | |
1247 idx_scalar_rep *r = dynamic_cast<idx_scalar_rep *> (rep); | |
1248 scalar = r->unconvert (); | |
1249 } | |
1250 break; | |
1251 | |
1252 case class_vector: | |
1253 { | |
1254 idx_vector_rep *r = dynamic_cast<idx_vector_rep *> (rep); | |
1255 array = r->unconvert (); | |
1256 } | |
1257 break; | |
1258 | |
1259 case class_mask: | |
1260 { | |
1261 idx_mask_rep *r = dynamic_cast<idx_mask_rep *> (rep); | |
1262 mask = r->unconvert (); | |
1263 } | |
1264 break; | |
1265 | |
1266 default: | |
1267 assert (false); | |
1268 break; | |
1269 } | |
1270 } | |
1271 | |
1272 Array<octave_idx_type> | |
1273 idx_vector::as_array (void) const | |
1274 { | |
1275 return rep->as_array (); | |
1276 } | |
1277 | |
1278 bool | |
1279 idx_vector::is_vector (void) const | |
1280 { | |
1281 return idx_class () != class_vector || orig_dimensions ().is_vector (); | |
1282 } | |
1283 | |
1284 octave_idx_type | |
1285 idx_vector::freeze (octave_idx_type z_len, const char *, bool resize_ok) | |
1286 { | |
1287 if (! resize_ok && extent (z_len) > z_len) | |
1288 { | |
1289 (*current_liboctave_error_handler) | |
1290 ("invalid matrix index = %d", extent (z_len)); | |
1291 rep->err = true; | |
1292 chkerr (); | |
1293 } | |
1294 | |
1295 return length (z_len); | |
1296 } | |
1297 | |
1298 octave_idx_type | |
1299 idx_vector::ones_count () const | |
1300 { | |
1301 octave_idx_type n = 0; | |
1302 | |
1303 if (is_colon ()) | |
1304 n = 1; | |
1305 else | |
1306 { | |
1307 for (octave_idx_type i = 0; i < length (1); i++) | |
1308 if (xelem (i) == 0) | |
1309 n++; | |
1310 } | |
1311 | |
1312 return n; | |
1313 } | |
1314 | |
1315 // Instantiate the octave_int constructors we want. | |
1316 #define INSTANTIATE_SCALAR_VECTOR_REP_CONST(T) \ | |
1317 template OCTAVE_API idx_vector::idx_scalar_rep::idx_scalar_rep (T); \ | |
1318 template OCTAVE_API idx_vector::idx_vector_rep::idx_vector_rep (const Array<T>&); | |
1319 | |
1320 INSTANTIATE_SCALAR_VECTOR_REP_CONST (float) | |
1321 INSTANTIATE_SCALAR_VECTOR_REP_CONST (double) | |
1322 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_int8) | |
1323 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_int16) | |
1324 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_int32) | |
1325 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_int64) | |
1326 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_uint8) | |
1327 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_uint16) | |
1328 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_uint32) | |
1329 INSTANTIATE_SCALAR_VECTOR_REP_CONST (octave_uint64) | |
1330 | |
1331 /* | |
1332 | |
1333 %!error id=Octave:index-out-of-bounds 1(find ([1,1] != 0)) | |
1334 %!assert ((1:3)(find ([1,0,1] != 0)), [1,3]) | |
1335 | |
1336 */ |