<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>extraction of array elements using selection logic</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-ca"><FONT FACE="Calibri">I’m looking for an ADMB form of R-style logical selection from arrays.</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri"></FONT></SPAN><SPAN LANG="en-ca"> <FONT FACE="Calibri">Ignore if this should be regarded as just a</FONT></SPAN><SPAN LANG="en-ca"> <FONT FACE="Calibri">C programming</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri"> question</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri"> and shouldn’t be here</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri">.</FONT></SPAN><SPAN LANG="en-ca"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT FACE="Calibri">I</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri"> currently use a bulky loop-based method to accomplish this</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri">,</FONT></SPAN><SPAN LANG="en-ca"> <FONT FACE="Calibri">looking for something more efficient</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri">. For example say I have a matrix BEFORE of index and value columns and I want to remove rows with values of zero to obtain matrix AFTER. Anybody know how to do this</FONT></SPAN><SPAN LANG="en-ca"> <FONT FACE="Calibri">in a few lines</FONT></SPAN><SPAN LANG="en-ca"> <FONT FACE="Calibri">without looping?</FONT></SPAN><SPAN LANG="en-ca"><FONT FACE="Calibri"></FONT></SPAN><SPAN LANG="en-ca"> </SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"> <FONT FACE="Calibri">BEFORE AFTER</FONT></SPAN></P>
<P DIR=LTR ALIGN=RIGHT><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">1 34.58641 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">1 34.58641 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">2 0 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">3 42.54367 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">3 42.54367 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">4 46.27856 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">4 46.27856 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">5 49.85982 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">5 49.85982 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">6 53.29379 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">6 53.29379 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">7 56.58652 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">7 56.58652 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">8 59.74382 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">8 59.74382 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">9 62.77126 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">9 62.77126 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> <FONT SIZE=2 FACE="Helv">10 65.67418 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Helv">10 65.67418 </FONT></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"> </SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><BR>
</SPAN><SPAN LANG="en-ca"></SPAN></P>
<UL DIR=LTR><UL DIR=LTR>
<P DIR=LTR><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Mark Fowler</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Population Ecology Division</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Bedford Inst of Oceanography</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Dept Fisheries & Oceans</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Dartmouth NS Canada</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">B2Y 4A2</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Tel. (902) 426-3529</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Fax (902) 426-9710</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Email Mark.Fowler@dfo-mpo.gc.ca</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Home Tel. (902) 461-0708</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Home Email mark.fowler@ns.sympatico.ca</FONT></SPAN></P>
</UL></UL>
<P DIR=LTR><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN><SPAN LANG="en-ca"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-ca"></SPAN></P>
</BODY>
</HTML>